A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Databases
»
JDBC
Author
About setBLOb & getBlob
shruty sharma
Greenhorn
Joined: Dec 25, 2008
Posts: 4
posted
Jan 05, 2009 06:56:43
0
Hi!!
I want to insert byte array in database schema as follows:
table message
{
msgid number(5),
messagevalue BLOB
};
I have done this in following way But I am getting NULL pointer exception.
//byte[] msgval .. contains byte values like 49 50 53 etc.
Blob
msg
;
msg.setBytes(1,msgval);
// for prepared statement I have used st2.setBlob(4,msg);
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
Jan 05, 2009 07:23:27
0
It´s hard to help without knowing the details.
http://faq.javaranch.com/java/TellTheDetails
Code depot of a Java EE / JSF developer
|
JSF / Eclipse / Tomcat kickoff tutorial
|
DAO kickoff tutorial
|
I ♥ Unicode
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: About setBLOb & getBlob
Similar Threads
Inserting image into the oracle database
storing BLOB
inserting BLOBs into MySQL database
inserting blob with CMP
How to convert an object into BLOB
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter