I have looked over the database and tables on the SQL 2005 server, and as far as I can tell, they all look the same as on the SQL 2000 server. However, I really don't know a whole lot about Microsoft SQL Server.
I could post a bunch of code here, but since the problem only is present with the SQL 2005 server, I figure the problem likely isn't with my code. I'm using the jTDS SQL driver with this application. Does anyone have any ideas?
Originally posted by Jeanne Boyarsky:
It sounds like the driver fixed something in the later version. Are you sharing connection/statement objects between the queries? Do you close all resources in a finally block?
I'm not sharing connection/statement objects, but I don't use a finally block to close the resources. I do it in the try block. Does that make a difference? I can try a finally block.
Closing the connections in a finally block didn't fix my problem. Also, I thought that the exception was only occurring when I did a second "follow-up" query, but it's now occasionally doing it on the initial query. There doesn't seem to be any common factor between queries that cause the exception. To make it worse, sometimes a certain query will work and sometimes the exact same query causes an exception. If it were possible, I'd just stick with the SQL 2000 server, but my agency has other plans for that server. You know what they say: if it ain't broke...
I'm using the jTDS SQL driver with this application.
Not sure if this would help, but you could try using the Microsoft JDBC Driver for SQL Server 2005