permaculture playing cards*
The moose likes JDBC and the fly likes Reading a blob object from a database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Reading a blob object from a database" Watch "Reading a blob object from a database" New topic
Author

Reading a blob object from a database

sajeev varghese
Greenhorn

Joined: Jan 27, 2006
Posts: 14
I tried to read a blob value from a Mysql database.But this field is obtained as java.sql.types varlongbinary instead of BLOB.
Now when i tried to read the content of the blob field which is an xml using
getbinaryStream method, i encountered some problems.
I have read the contents into a byte array using read method of inputstream
and when i converted this byte array to a string using toString it returns the byte array object value and not the orirginal contents.
Actually i want to read this content and insert into a clob field of an oracle database.
Somebody Please help me to sort out the problem.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60732
    
  65

"sajeev V",

You have already received two warning to change your display name to conform to JavaRanch standards. Your name must be a first name and a last name separated by a space. An initial will not do.

This is your final warning. Change your display name to a valid value prior to your next post. Otherwise, your account will be closed.

bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
wood burning stoves
 
subject: Reading a blob object from a database
 
Similar Threads
How to upload a byte array into BLOB column?
Display BLOB contents to the client
jdbc oracle and blob
Problem inserting Blob into Oracle DB
Converting LONGVARBINARY of HSQL to BLOB of Derby