我厌倦了搜索没有结果我不知道问题来自哪里,我试图连接我的android应用程序与本地SQl服务器2008年,现在我得到无法从sql server获取信息。请帮助,这是我的代码:使用jtds连接android应用程序到sql server
String url = "jdbc:jtds:sqlserver://10.0.2.2:1433/lear_db;instance=SQLEXPRESS;";
TextView coucou = new TextView(this);
try {
Class.forName("net.sourceforge.jtds.jdbc.Driver");
java.sql.Connection connexion =
DriverManager.getConnection(url,"kamal","kamal1234");
coucou.setText("Connection successful");
} catch (SQLException e) {
// TODO Auto-generated catch block
coucou.setText("error1" + e.getMessage());
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
coucou.setText("error2" + e.getMessage());
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
coucou.setText("error0" + e.getMessage());
e.printStackTrace();
}
setContentView(coucou);
查看我的[回复](http://stackoverflow.com/a/15273775/2024761)以查看'JAR'是否存在。如果它仍然存在,那么跟踪粘贴错误堆栈。 – SudoRahul 2013-03-07 16:51:58