配置:SQlserver 2014。 SQL Server Browser - 正在运行。防火墙 - 已禁用
String URL = "jdbc:jtds:sqlserver://192.168.2.22/spin;instance=SQLEXPRESS";
String USER = "XXXX";
String PASS = "XXXX";
Class.forName("net.sourceforge.jtds.jdbc.Driver");
Connection con = DriverManager.getConnection(URL, USER, PASS);
这个在java客户端工作,但在Andorid应用程序中没有我收到此错误“无法从SQL Server获取信息”
11-08 10:35:07.011 5684-5698/zkc.com.nfcread W/System.err: java.sql.SQLException: Unable to get information from SQL Server: 172.16.4.10.
11-08 10:35:07.012 5684-5698/zkc.com.nfcread W/System.err: at net.sourceforge.jtds.jdbc.MSSqlServerInfo.<init>(Unknown Source)
11-08 10:35:07.015 5684-5698/zkc.com.nfcread W/System.err: at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(Unknown Source)
11-08 10:35:07.015 5684-5698/zkc.com.nfcread W/System.err: at net.sourceforge.jtds.jdbc.Driver.connect(Unknown Source)
11-08 10:35:07.015 5684-5698/zkc.com.nfcread W/System.err: at java.sql.DriverManager.getConnection(DriverManager.java:175)
11-08 10:35:07.015 5684-5698/zkc.com.nfcread W/System.err: at java.sql.DriverManager.getConnection(DriverManager.java:209)