Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Pranav Raulkar
Ranch Hand
Posts: 73
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic