Android開發(fā)連接mysql云數(shù)據(jù)庫中遇到的的一些問題
1、必須新開線程
目前遇到的最大的問題是,連接云需要new一個(gè)Thread,不可以直接寫在主線程中。
2、版本問題
我開始使用的jdbc是8.0.15版本,出現(xiàn)錯(cuò)誤java.sql.SQLNonTransientConnectionException: Could not create connection to database server。然后換成了5.1.48版本才成功連接。
3、編譯錯(cuò)誤
提示是Complier Error,解決方案是在app下的gradle中增加如下代碼:
compileOptions { sourceCompatibility 1.8 targetCompatibility 1.8 }

浙公網(wǎng)安備 33010602011771號(hào)