tags:

views:

238

answers:

1

Moved a bunch of databases from sql server 2000 to 2008. One of the applications is on JBoss 3.2.2 and is now failing to connect to the database. The particular error is "The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorect. Parameter 1 (""): Data type 0x38 is unknown." I looked around google for a while have determined this is because I'm using MS SQL Server 2000 Driver for JDBC and this driver will not work with MSSql server 2008. It will connect but will not work.

So my question is how do I get Jboss to use the new MSSql server JDBC driver version 2.

I'm not familiar with JBoss at all. The new driver comes with a JAR file but I'm not sure how to tell JBoss to use that instead of the old driver.

Thank you in advance for all your help.

+3  A: 

Most often , to make the JDBC driver class available to JBoss, the driver's jar is copied to the lib directory of the default server configuration (assuming that is the configuration you are running, of course).

So, in order to make JBoss use the new driver, remove the old jar from the lib directory (if it's not there look at the startup script and find from where it's added to the $CLASSPATH), replace it with the new driver, update your mssql-ds.xml if required (especially the <connection-url> and <driver-class>, check the driver documentation), restart Jboss.

Pascal Thivent
I think this puts me in the right path. I found a mssqlserver.jar in jboss\server\all\lib but didn't find it in defaul or minimal. And I'm not sure if this is the old driver or not is there a way I can make sure?I'm using eclipse as IDE can you tell me how to check the $CLASSPATH?Thanks
Tigran
Yes, this is it (jboss/server/all/lib is shared by all configurations). One way to make sure would be to remove the jar and check if you get a ClassNotFoundException at JBoss startup (in other words, you shouldn't be able to access a database at all). But I'm sure its the jar you're looking for.
Pascal Thivent
Removing the msbase.jar, mssqlserver.jar and msutil.jar causes a connection error. Then I copy the new sqljdbc.jar into the lib folder and get the following error. Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: com.microsoft.jdbc.sqlserver.SQLServerDriver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: com.microsoft.jdbc.sqlserver.SQLServerDriver). BTW after copying the new driver I do modify the mssql-ds.xml file to read the new driver. thank you
Tigran
figured it out. problem is with JRE. I'm using 1.4 and the new JDBC 2.0 driver from MS does not support 1.4 it says I have to upgrade to 5.0.
Tigran
The SQL Server 2005 JDBC driver class name is **"com.microsoft.sqlserver.jdbc.SQLServerDriver"**. In addition, the SQL Server 2005 JDBC driver has a different URL prefix from the SQL Server 2000 JDBC driver. The SQL Server 2000 JDBC driver uses an URL prefix of "jdbc:microsoft:sqlserver://", while the SQL Server 2005 JDBC driver uses an URL prefix of **"jdbc:sqlserver://"**. http://blogs.msdn.com/jdbcteam/archive/2007/06/15/java-lang-classnotfoundexception-com-microsoft-jdbc-sqlserver-sqlserverdriver.aspx
Pascal Thivent
Pascal Thivent
Yes I did notice the url prefix is different. I used the MS JDBC 1.2 driver which MS says is for SQL 2005 but it works for 2008. I'm back in business. Thank you very much for all the help.
Tigran