• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The TDS protocol does not support JDBC datatype 2000

 
Manish Doomra
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I have written a Stored Procedure in which there is a datetime parameter which when receives a null value, computes a new value from some other table.


Note: @param_date is of datatype 'datetime'.

While triggering the Stored Procedure from Java code, an exception is thrown:-
java.sql.SQLException: The TDS protocol does not support JDBC datatype 2000.
at net.sourceforge.jtds.jdbc.TdsData.getNativeType(TdsData.java:1526)
at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1016)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:537)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.execute(JtdsPreparedStatement.java:562)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:209)


While preparing the statement to execute, when a null parameter is encountered in code it does the following:-


where stmt is an object of CallableStatement.
Note:- While navigating to java.sql.Types.JAVA_OBJECT we observed the following statement:-


This problem is encountered only when the jdbc driver class is
net.sourceforge.jtds.jdbc.Driver and no problem is seen when we change the driver class to com.microsoft.sqlserver.jdbc.SQLServerDriver

But we need to use net.sourceforge.jtds.jdbc.Driver, so is there any solution to fix the same... ???
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is very surprising. jTDS has been very stable for some time, which version are you using?
 
Manish Doomra
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:That is very surprising. jTDS has been very stable for some time, which version are you using?


Hi Paul, we are using jtds 1.2.2
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well that's a new as it gets, so presumably if they are aware of it the developers don't see this as a bug.
 
Manish Doomra
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manish Doomra wrote:
Paul Sturrock wrote:That is very surprising. jTDS has been very stable for some time, which version are you using?


Hi Paul, we are using jtds 1.2.2


Hi Paul, it worked when i changed to
 
Manish Doomra
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:Well that's a new as it gets, so presumably if they are aware of it the developers don't see this as a bug.


Hi Paul, it worked when i changed stmt.setNull(i, java.sql.Types.JAVA_OBJECT); to stmt.setNull(i, java.sql.Types.TIMESTAMP);

As we are setting a null in a datetime datatype column

Thank you all
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic