File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Problems with ResultSet.getBlob Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Problems with ResultSet.getBlob" Watch "Problems with ResultSet.getBlob" New topic

Problems with ResultSet.getBlob

Alejandro Barrero
Ranch Hand

Joined: Aug 01, 2005
Posts: 327
I am inserting files in databases and reading them back. I am having problems reading the blobs. In MySQL getBlob() fails with an exception and my solution was to use getObject() and cast to byte[]; that works perfect. But now, I am trying to do the same with Microsoft Access; getBlob() fails as before and (byte[])getObject() still works but the contents is different from what I stored. I can use whatever way there is to store the contents of files in an Access database (I know it is not a real database but when you have to use it you have to use it).
Your help will be greatly appreciated,

Alejandro Barrero

Your help will be greatly appreciated,
Alejandro Barrero
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
Does MSAccess suppourts Blob Data Type??

If you want something you never had do something which you had never done
Jhakda Velu
Ranch Hand

Joined: Feb 26, 2008
Posts: 167
Try using the GetChunk and AppendChunk methods. Check this site.
MSDN Support Site

Hope it helps.


If I become filthy rich, I'll sponsor research for painless dental treatment at Harvard Medical School. Thats why,I'm learning Java.I have 32 teeth, 22 are man made.
I agree. Here's the link:
subject: Problems with ResultSet.getBlob
It's not a secret anymore!