aspose file tools*
The moose likes JDBC and the fly likes storing byte[] in a (oracle)blob Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "storing byte[] in a (oracle)blob" Watch "storing byte[] in a (oracle)blob" New topic
Author

storing byte[] in a (oracle)blob

snoofle
Greenhorn

Joined: Jan 09, 2002
Posts: 26
hello all,
i've have again a problem with storing a byte[] in a blob under oracle ...
is there a way to store byte[]like this ( or another way any help is great ) ?

i have an example with a filestream, but no idea how to insert byte[] directly ...

tia
andreas
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879


the above might work for you. If not try these:
There is more info
here.
Jamie
Harry Wood
Greenhorn

Joined: Jan 28, 2004
Posts: 16
Yeah 'ps.setBinaryStream' worked for me.

...and for reading the blob back again I used:

Trying to use 'resultSet.getBytes' seemed to work, but it always came back with 86 bytes of useless poo (???)

Probably all depends what JDBC driver you're using though.
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Hello "snoofle"-

Welcome to JavaRanch.

On your way in you may have missed that JavaRanch has a policy on display names, and yours does not comply with it - please adjust it accordingly, which you can do right here. Thanks for your prompt attention to this matter.

Enyoy your time here.


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30772
    
156

Ajith,
Given Snoofle's posting date of 2002, it sounds like he's long gone. I suspect he won't give the display name any "prompt attention"

Harry,
When you do a search, note that the date of each post is on top. Ones from the past are valuable to read, but not likely awaiting help.


[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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: storing byte[] in a (oracle)blob