February 23, 2004

SQL Server JDBC driver troubles

I'm responsible for a small struts application for one of my clients. The application was originally coded on Windows against a SQL Server 2000 database. When I was contracted to roll it to production, a Linux box talking to a SQL Server 7 database, I found I couldn't use the existing MS JDBC drivers, which only support SQL Server 2000. So, I went looking for SQL Server 7 JDBC drivers. There are a ton of choices out there, but most are commercial. I looked at jTDS, but that didn't work because, at the time, jTDS did not support CallableStatements, which were used extensively by this application. (Apparently, jTDS does now.)

So, I looked at a few commercial drivers, and decided that Opta2000 offered the best feature set for the price ($800 for unlimited web application connections). Then, the database was upgraded from SQL Server 7 to SQL Server 2000. Luckily, we hadn't bought the JDBC driver yet, so, hey, let's use MS JDBC drivers--they're free! Fantastic. The installation went fine (not that it was that complicated--dropping some new jars in the WEB-INF/lib directory and changing some lines in the struts-config.xml

Except, Tomcat (version 4.1.24) started behaving badly. With IE (and, to a lesser extent, with Mozilla), the pages started loading very slowly after Tomcat had been running for a while. A restart alleviated this symptom, but didn't obviously solve the problem. Initially, we thought it was the load, and some misconfiguration of tomcat (tomcat was serving images--not usually considered its strong point, though benchmarks are needed to tell the full tale), but nothing seemed to change the behavior. We tried changing how tomcat was passed requests (mod_jk, mod_proxy), but nothing seemed to work. A colleague of mine looked at when the instability started, and it correlated with the installation of the MS JDBC drivers. So, we switched back to Opta. The application returned to a stable state, and we haven't seen the problems since. (We plan to purchase the drivers now, although we may take a look at jTDS.)

Posted by moore at February 23, 2004 05:44 PM

Such timing of this blog with TSS! Today TSS has a story on how it is most of the time the database and its connections that cause most of the heartache in the J2EE world


Posted by: Kris Thompson at February 24, 2004 07:36 AM | Permalink

If you haven't purchased the Opta drivers yet, take another look at jTDS. We have released a fully featured version (0.7.1) last month and we are really close to another release that fixes the last big problem: locking issues caused by concurrent Statements.

Posted by: Alin Sinpalean at March 16, 2004 08:22 AM | Permalink

Does anyone know how struts-config.html file should be configured for jTDS JDBC driver.

This seems to result in the following error
Can anyone help?


Posted by: Shankar at June 6, 2004 02:18 PM | Permalink


setLogWriter() was not implemented prior to 0.9-rc1. This feature is available in the current driver. Also, we expect that 0.9 with pass the JDBC compliance tests and plan on certifying the driver as soon as possible.


Posted by: Brian Heineman at August 24, 2004 09:07 PM | Permalink
© Moore Consulting, 2003-2006