| | |
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 |
-xlint add android api applet application applications array arrays automation bank bi binary blackberry bluetooth chat class client code compile compiler component database development digit eclipse equation error event fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image infinite input int integer j2me java javame javaprojects jetbrains jni jpanel jtable julia learningresources linux list login loop main map method methods mobile myregfun netbeans newbie nonstatic notdisplaying pearl problem program programming project qt recursion scanner screen scrollbar server set sms sort sorting spamblocker sql sqlserver string superclass swing system text-file thread threads tree variablebinding windows xor





