jdbc - Use of jTDS to connect to SQL Server 2012 throws IOException; MS SQL Driver works -
the following code using jtds driver (1.3.1):
drivermanager.getconnection("jdbc:jtds:sqlserver://anipaddress;databasename=adatabase", "user", "pass")
results in:
java.sql.sqlexception: i/o error: db server closed connection. @ net.sourceforge.jtds.jdbc.tdscore.nexttoken(tdscore.java:2481) @ net.sourceforge.jtds.jdbc.tdscore.login(tdscore.java:632) @ net.sourceforge.jtds.jdbc.jtdsconnection.<init>(jtdsconnection.java:371) @ net.sourceforge.jtds.jdbc.driver.connect(driver.java:184) @ java.sql.drivermanager.getconnection(unknown source) @ java.sql.drivermanager.getconnection(unknown source) @ com.seasset.crd.test.testdb.main(testdb.java:20) caused by: java.io.ioexception: db server closed connection. @ net.sourceforge.jtds.jdbc.sharedsocket.readpacket(sharedsocket.java:852) @ net.sourceforge.jtds.jdbc.sharedsocket.getnetpacket(sharedsocket.java:731) @ net.sourceforge.jtds.jdbc.responsestream.getpacket(responsestream.java:477) @ net.sourceforge.jtds.jdbc.responsestream.read(responsestream.java:114) @ net.sourceforge.jtds.jdbc.tdscore.nexttoken(tdscore.java:2368)
however, code using ms sql driver (4.2) works without exception:
drivermanager.getconnection("jdbc:sqlserver://anipaddress;databasename=adatabase", "user", "pass")
i'm trying connect sql server 2012 database. note: user has read access database. not have permission change configuration on sql server 2012. have tried same code connect sql server 2005 database, , both microsoft , jtds drivers work without exception in case.
how can connect sql server 2012 database without exception using jtds?
Comments
Post a Comment