Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to store /retrieve image to/from MS ACCESS  RSS feed

 
Sameer Chandra
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am developing a GUI (swing) that will store data (txt and images ) into MS Access database. In MS Access , images can be stored as OLE object. Can anyone please tell me how to retrieve images from ACCESS ?

Thanks,

SAM
 
Rob Spoor
Sheriff
Posts: 21088
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More of a JDBC issue.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37230
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read about CLOBs in the JDBC tutorial yet?
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Images are binary data, don't use CLOB. Use a BLOB. Create a binary field in the database and use PreparedStatement#setBinaryStream() to store it and ResultSet#getBinaryStream() to retrieve it. Not sure if that is supported by MSAccess as well as it isn't a decent database. Otherwise either upgrade to a decent RDBMS or store the images in the file system and save the path in the database. After all, saving binary data in a database may improve portability, but it doesn't make much sense as you cannot index and search it in the DB.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!