Android开发连接mysql云数据库中遇到的的一些问题

  1、必须新开线程

  目前遇到的最大的问题是,连接云需要new一个Thread,不可以直接写在主线程中。

  2、版本问题

  我开始使用的jdbc是8.0.15版本,出现错误java.sql.SQLNonTransientConnectionException: Could not create connection to database server。然后换成了5.1.48版本才成功连接。

  3、编译错误

  提示是Complier Error,解决方案是在app下的gradle中增加如下代码:

  

compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
原文地址:https://www.cnblogs.com/YXSZ/p/14530678.html