Win a copy of Java 9 Revealed this week in the Features new in Java 9 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: 20937
81
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
Marshal
Posts: 36616
474
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!