• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDBC - BLOB question - any java guru with an answer?

 
sanz nsgha
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. I have created a table tblRead in Access 2000 with only 1 field:
Field name: Notes
Field type: OLE Object (BLOB equivalent in Access)
2. I have a Java app - something like this:
ResultSet rs = stmt.executeQuery("select Notes from tblRead");
Blob data = rs.getBlob("Notes");
java.io.InputStream in = data.getBinaryStream();
int i;
while ((in.read()) > -1) {
i = in.read();
System.out.println(i);
}
Compiles fine. But gives exception: java.lang.UnsupportedOperationException.
Anybody, any idea where it went wrong?
Thanks
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
your driver does not support BLOB operations on your database. You'll have to update/change your ( presumeably ODBC ) MSAccess ODBC drivers to support this feature, although I don't know if even the latest jdbc dbc bridge/MS Access driver combo support BLOBs, so you may have to buy one that supports this.
Jamie
 
sanz nsgha
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. DO you know any of such drivers?
 
What a show! What atmosphere! What fun! What a tiny ad!
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!