| | |
Help
![]() |
•
•
Join Date: Sep 2008
Posts: 34
Reputation:
Solved Threads: 0
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");
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");
![]() |
Other Threads in the Java Forum
- Previous Thread: java app with INSERT statement...
- Next Thread: multiple stack in one dimentional array using node/ linked list
| Thread Tools | Search this Thread |
911 actionlistener addressbook android api append applet application array arrays automation binary block bluetooth character chat class client code component consumer csv database desktop developmenthelp eclipse error fractal ftp game gameprogramming givemetehcodez graphics gui html ide image integer j2me j2seprojects japplet java javaarraylist javac javaee javaprojects jni jpanel julia lego linked linux list loops mac map method methods mobile netbeans newbie number objects online oriented panel printf problem program programming project projects properties recursion replaydirector reporting researchinmotion rotatetext rsa scanner se server set singleton sms sort sql string swing test textfields threads time title tree tutorial-sample ubuntu update windows working





