This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

storing byte[] in a (oracle)blob  RSS feed

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

the above might work for you. If not try these:
There is more info
here.
Jamie
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
author & internet detective
Marshal
Posts: 37714
579
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!