Announcement and Discussions related to the Microsoft JDBC driver for SQL Server
We are excited to announce the newest release of the Microsoft SQL Server JDBC Driver 2.0!
This version of the JDBC driver supports features introduced in the JDBC 4.0 API, including:
· national character set data types: NCHAR, NVARCHAR, LONGNVARCHAR, NCLOB
· SQLXML data type
· Wrapper interface to access SQL Server JDBC Driver specific methods
· client info properties
· new database metadata methods
· LOB creator methods
The 2.0 driver also adds:
· default adaptive response buffering behavior
· support for SQL Server 2008 collations
· enhanced tracing, including public method entry and exit traces
· performance improvements and bug fixes
Please feel free to download a copy and see for yourself!
A repro consists of a Java code sample that demonstrates the problem when compiled and run standalone.
If that is something that you cannot (easily) provide then working with a Microsoft Customer Support engineer to scope the problem and investigate it thoroughly is probably a better approach to getting the problem solved.
--David Olix [SQL Server]
Currently we few of our applications are using SQL JDBC Driver 1.2 and we are planning to move to JDBC 2.0 (we are also moving from SQL 2000 to SQL 2008). In the past we had issues with XA transaction and that was fixed by hotfix KB 950520. We have the following questions/concerns before we make this move. I will appreciate any response from your team.
1. Can we install multiple versions of JDBC drivers side by side on the same client machine (for example we want to have JDBC 1.2 and 2.0 drivers since we may not be able to move all our exiting applications to use JDBC 2.0)
2. We assume that if any application is using the 2.0 JDBC driver AND that application uses XA, that we must use the 2.0 version of the XA DLL. That you can’t use the 2.0 jar file with the 1.2 DLL. Is that correct?
3. If we install the 2.0 XA DLL, can some applications continue to use the 1.2 JDBC driver? In other words, is the 2.0 XA DLL backwards compatibly with older 1.2 jar file?
4. Is the 2.0 JDBC driver and related XA DLL an improvement from a stability point of view when compared to our 1.2 driver (XA transaction in 1.2 was fixed in hotfix KB 950520)? In other words, are we going to see XA issues with the 2.0 driver?
We use the sqljdbc4.jar from sqljdbc_2.0.1803.100_enu.tar.gz
It works fine in our application.
However the Ant "sql" task fails upon connection. We/I use this often; it's very simple/vanilla. Thus, odd that it fails.
Here's the error:
"The server version is not supported. The target server must be SQL Server 2000 or later."
It works for 2000, and 2005, but fails in 2008. Odd.
We're running sql server 2008 SP1 Enterprise
Here's a stack trace excerpt:
com.microsoft.sqlserver.jdbc.SQLServerException: The server version is not supported. The target server must be SQL Server 2000 or later.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.DBComms.Prelogin(Unknown Source)
at com.microsoft.sqlserver.jdbc.DBComms.<init>(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
fyi, I have cross-posted this on stack overflow.
It looks like the ant path is not picking up the right jar. The error from the callstack looks like coming not from a 2.0 driver but something like 1.1. Make sure that your ant class path has the 2.0 jar.
Mohammed, please see inline for answers
Yes, as far as you set your class paths correctly for your applications to pick up the right versioned jars.
Yes. 2.0 driver has to have the 2.0 dll not with 1.2 dll.
Yes, 2.0 XA dll will work with 1.2 jar.
There are no outstanding issues in the 2.0 driver that we think needs to be fixed at this time.
I am using SQL Server 2008 and am using the JDBC 2.0 driver to connect to the database. I use the Apache Tomcat server integrated into the Eclipse IDE.I am trying to connect using a dynamic web application in the Eclipse IDE and it gives me an error saying com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication
When I use the same code for connecting to a desktop application, it works fine. I think there is some problem with placing my 'sqljdbc_auth.dll'. Could you guide me as to where I would have to place my .dll for the application to run in Eclipse with the Tomcat server?
Where did you place your integrated auth dll. Have you followed the instructions in this link on the integrated authentication section
Usually placing in the windows system directory works for all applications. I am not sure if Apache Tomcat requirements are different.
I've read posts above, but it seems NOCOUNT doesn't help
Here is my code:
SQLServerDataSource ds = new SQLServerDataSource();
Connection con = ds.getConnection();
Statement stm = con.createStatement();
stm.execute("SET NOCOUNT ON; \n" +
"create table #tmp(id int);\n" +
methods "execute" and "executeUpdate()" don't throw SQLException, whilst "SET NOCOUNT ON" is presented.
While debbuging I've noticed that
stm.executeQuery("SET NOCOUNT ON;\n" +
"select 1 as id");
throws SQLServerException: The statement did not return a result set.
It seems like SET NOCOUNT ON is ignored?
I forgot to say, that the problem occurs on 2.0 and 3.0 CTP