File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes diff between two methods to write the blob into the db Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "diff between two methods to write the blob into the db" Watch "diff between two methods to write the blob into the db" New topic
Author

diff between two methods to write the blob into the db

karthik venkatesan
Greenhorn

Joined: Dec 31, 2004
Posts: 26
Hi,

We can store the blob in db using any of the following,

1. using setBlob method

2. Inserting emptyBlob()
selecting that particular blob row
get the binary output stream
insert into db

Whats the difference between these two methods?
Anyother way to insert the blob into db?

Thankx in advance.

Regards,
Karthik
karthik venkatesan
Greenhorn

Joined: Dec 31, 2004
Posts: 26
sorry, I have written setBinaryStream instead of setBlob method in the above post.

Any help will be appreciated...

Thanks

Regards,
Karthik
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31075
    
232

Karthik,
You can actually use setBlob() or setBinarySteam(). Personally, I prefer setBinaryStream as it doesn't tie me to the database as closely.

For the future, note that you can edit a post by clicking the paper and pencil icon on the line with the post's date and time.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
karthik venkatesan
Greenhorn

Joined: Dec 31, 2004
Posts: 26
Hi,

Thankx jeanne, thanks a lot for the info.

Regards,
Karthik
[ June 08, 2005: Message edited by: karthik venkatesan ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: diff between two methods to write the blob into the db