• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java and OLE Objects  RSS feed

 
Mitchell Robert
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

At the moment I have a Microsoft Access database with an OLE Object holding a picture.
I have tried to find code to retrieve the image saved in the OLE Object but to no success.

If there is anyone that can help me with this?

This is what I have so far but it is outputting NULL after '4'
With a 'java.lang.NullPointerException'



Regards
Mitchell
 
Paul Clapham
Sheriff
Posts: 22841
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That means that what you read from the binary stream was not an image. As a result the "read" method returns null, your code sees that and prints "NULL", and then your code proceeds to treat the null value as if it were an object, which causes the NullPointerException.

So what you read from the binary stream is not an image. In fact (as you already know) it's an OLE object which contains an image. And the ImageIO class knows nothing about OLE, so it doesn't attempt to extract the image from the OLE object. It just gives up and returns null.
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mitchell, please BeForthrightWhenCrossPostingToOtherSites
http://www.codeproject.com/Questions/429606/Java-and-OLE-Objects

You were given a search link on that thread. Didn't it get you anything useful?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!