Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

How to store /retrieve image to/from MS ACCESS

 
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
 
Sheriff
Posts: 21922
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More of a JDBC issue.
 
author & internet detective
Posts: 39957
804
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read about CLOBs in the JDBC tutorial yet?
 
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.
 
keep an eye out for scorpions and black widows. But the tiny ads are safe.
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic