Use Varbinary data in PrepareStatement
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Isteyaq_Zahur
Posted On:   Sunday, October 7, 2001 10:08 PM

Hello , I want to know how to use varbinary data in PrepareStatement using jdbc driver. I have tried to use setBytes() for setting parameter to prepare statement but it does not work, and it doesn't throw error. I got a resultset with no rows in it. I'm working in MS SQLServer 7.0 using com.inet.Tds Driver ------------------------------------------------------------------------ ie. byte[] b = "0xD134B1CAACA5D511".getBytes(); String query = "Select * from tUser where empno=?"; PreparedStatement pStmt = mConnection.prepareStatement(query); pStmt.setBytes(1,b); ResultSet rs = pStmt.executeQuery(); ------------------------------------------------------------------------    More>>

Hello ,
I want to know how to use varbinary data in PrepareStatement using jdbc driver. I have tried to use setBytes() for setting parameter to prepare statement but it does not work, and it doesn't throw error. I got a resultset with no rows in it. I'm working in MS SQLServer 7.0 using com.inet.Tds Driver
------------------------------------------------------------------------
ie.

byte[] b = "0xD134B1CAACA5D511".getBytes();
String query = "Select * from tUser where empno=?";
PreparedStatement pStmt = mConnection.prepareStatement(query);
pStmt.setBytes(1,b);
ResultSet rs = pStmt.executeQuery();
------------------------------------------------------------------------

Pliz help me . Thanks in advance

   <<Less
About | Sitemap | Contact