Skip to content

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.xmlTomcat (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.)

4 thoughts on “SQL Server JDBC driver troubles

  1. Alin Sinpalean says:

    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.

  2. Shankar says:

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

    This seems to result in the following error
    setLogWriter() NOT IMPLEMENTED
    Can anyone help?

    Thanks

  3. Brian Heineman says:

    Shankar,

    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.

    -Brian

Comments are closed.