File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes com.microsoft.sqlserver.jdbc.SQLServerException: The TDS protocol stream is not valid. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "com.microsoft.sqlserver.jdbc.SQLServerException: The TDS protocol stream is not valid." Watch "com.microsoft.sqlserver.jdbc.SQLServerException: The TDS protocol stream is not valid." New topic
Author

com.microsoft.sqlserver.jdbc.SQLServerException: The TDS protocol stream is not valid.

Pranav Raulkar
Ranch Hand

Joined: Apr 20, 2011
Posts: 73

Hi guys, I'm running a program that connects with Microsoft SQL Server 2008. It runs smoothly for some time and then throws an exception - com.microsoft.sqlserver.jdbc.SQLServerException: The TDS protocol stream is not valid. I found that this exception is thrown while I'm freeing the resources. Here is my code to free the resources.



I'm probably using sqljdbc driver version older than 3.0. Also I came to find out probably there is a bug with sqljdbc as it always return error code = 0 when there is connection problem.
What might be the issue with older jar. I tried with sqljdbc jar version 3, it doesn't work and prints out

"Exception occurs in createConnection=Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.java.lang.UnsupportedOperationException: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0."

in my log. So I'm using sqljdbc4 now. It seems to work fine, but will it happen that like old jar it will throw exception after some time like in case of old jar. Please help
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

It is recommended that, you use the recommended versions of software when setting up an environment for execution. If so, this issue will never occur.


S.D. MADHAN
Not many get the right opportunity !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: com.microsoft.sqlserver.jdbc.SQLServerException: The TDS protocol stream is not valid.
 
Similar Threads
exception while running my first jdbc code
Cannot Connect To MS-SqlServer 2008 R2
getGeneratedKeys() causing exception
MS-SQL Data ResultSet Problem
No suitable driver found for JDBC