Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's the correct way to insert a blob in a database?

Status
Not open for further replies.

SuperMoonster

Programmer
Aug 11, 2005
59
BR
What's the correct way to insert a blob in a database? I've tried some I found on the web but didn't work. Could someone give me an example? I should use blob or byte? I intend to insert a String in a BLOB SUBTYPE 1 field.
 
read the documentation for your jdbc driver. in oracle, you can create an oracle Blob object, and insert using a prepared statement.

-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
The easiest way to write a BLOB (Binary large object) is to use the setBytes().
I would advoid creating an actual java.sql.Blob object - there is no real point.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top