Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question on JDBC - BLOB

 
sanz nsgha
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Experiments on servlets ...
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?
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sanjay you cross posted this post in lots of places. It belongs in one forum JDBC, and there only. Please stop cross posting.
Mark
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. 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!