无法使用jTDS创建与SQLServer的连接

时间:2013-10-14 18:09:13

标签: java android sql-server jtds

我正在尝试使用jTDS连接到Android应用程序中的SQLServer 2000。我最初使用jTDS 1.3.1尝试了这个,但这导致了类找不到错误,所以我切换到了1.2.8。现在,当我创建连接时,当我尝试创建连接时,我收到以下异常:

10-14 14:04:07.812: W/System.err(15375): java.sql.SQLException: Charset 0x0404D00000/MS950 is not supported by the JVM.
10-14 14:04:07.822: W/System.err(15375):    at net.sourceforge.jtds.jdbc.ConnectionJDBC2.loadCharset(ConnectionJDBC2.java:1445)
10-14 14:04:07.822: W/System.err(15375):    at net.sourceforge.jtds.jdbc.ConnectionJDBC2.setCollation(ConnectionJDBC2.java:1525)
10-14 14:04:07.832: W/System.err(15375):    at net.sourceforge.jtds.jdbc.TdsCore.tdsEnvChangeToken(TdsCore.java:3285)
10-14 14:04:07.832: W/System.err(15375):    at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2352)
10-14 14:04:07.832: W/System.err(15375):    at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:616)
10-14 14:04:07.832: W/System.err(15375):    at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:356)
10-14 14:04:07.832: W/System.err(15375):    at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:188)
10-14 14:04:07.832: W/System.err(15375):    at java.sql.DriverManager.getConnection(DriverManager.java:175)

我在其他地方看到类似的错误,其中问题是格式错误的JVM安装但是因为我在Android环境中这没有意义。

考虑到提问者在this question的成功,我也尝试了1.2.7但是没有用。

编辑:

这是我的调用代码,虽然我不确定它有助于辨别问题。它采用AsyncTaskdoInBackground方法:

if(this.sqlConnection==null){
    Properties connectionProps = new Properties();
    connectionProps.put("user", "sa");
    connectionProps.put("password", **REMOVED**);
    this.sqlConnection = DriverManager.getConnection("jdbc:jtds:sqlserver://192.100.100.6/MES", connectionProps);
    this.checkTestsStatement = this.sqlConnection.prepareStatement("SELECT TOP 10 * from ATE_Test_Log where EndTime < ?");
}

0 个答案:

没有答案
相关问题