943,670 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 407
  • Java RSS
Jan 6th, 2009
-1

Help

Expand Post »
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");
Reputation Points: 9
Solved Threads: 0
Light Poster
srs_grp is offline Offline
34 posts
since Sep 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: java app with INSERT statement...
Next Thread in Java Forum Timeline: multiple stack in one dimentional array using node/ linked list





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC