Help

Reply

Join Date: Sep 2008
Posts: 34
Reputation: srs_grp is an unknown quantity at this point 
Solved Threads: 0
srs_grp srs_grp is offline Offline
Light Poster

Help

 
-1
  #1
Jan 6th, 2009
I have byte array that contains (49 50 58 57 57).
I'm storing this byte array in blob by using setBytes() method of
preparedStatement.
But in database,it is stored in different manner i.e,
31323A3939.
When I try to retrieve value of this blob using getBytes() method,
I'm getting output as bytes of 31323A3939.
What is the problem?




// While inserting data in database

st2=con1.prepareStatement("insert into message1 values (?,?,?,?,?)");
st2.setString(1,sid);
st2.setString(2,headerid);
st2.setString(3,fid);
//st2.setBlob(4,h);
//st2.setBlob(5,m);
st2.setBytes(4,headerval_t);
st2.setBytes(5,msgvalue_t);


int count=st2.executeUpdate();



// For Retreiving data


byte a[]=rs.getBytes("hvalue");
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC