极限第三天
Posted yyl141
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了极限第三天相关的知识,希望对你有一定的参考价值。
今天主要从事JDBC连接mysql
try {
Class.forName("com.mysql.jdbc.Driver");
Log.v(TAG, "加载JDBC驱动成功");
} catch (ClassNotFoundException e) {
Log.e(TAG, "加载JDBC驱动失败");
return;
}
String ip = "192.168.0.103";
int port = 3306;
String dbName = "ku";
String url = "jdbc:mysql://" + ip + ":" +...
+ "/" +...;
String user = "root";
String password = "root";
try {
Connection conn = DriverManager.getConnection(url, user, password);
conn.close();
} catch (SQLException e) {
Log.e(TAG, "远程连接失败!");
return;
}
Class.forName("com.mysql.jdbc.Driver");
Log.v(TAG, "加载JDBC驱动成功");
} catch (ClassNotFoundException e) {
Log.e(TAG, "加载JDBC驱动失败");
return;
}
String ip = "192.168.0.103";
int port = 3306;
String dbName = "ku";
String url = "jdbc:mysql://" + ip + ":" +...
+ "/" +...;
String user = "root";
String password = "root";
try {
Connection conn = DriverManager.getConnection(url, user, password);
conn.close();
} catch (SQLException e) {
Log.e(TAG, "远程连接失败!");
return;
}
以上是关于极限第三天的主要内容,如果未能解决你的问题,请参考以下文章