• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Storing images in MySQL database

 
niku shah
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am developing Shopping cart , in that clients can also sell their products.

For that purpose products images is to be stored .....

can anybody tell how cani do this ?

well i m using Tomcat , Servlets and MySql DBMS......

Thanks
 
Scott Selikoff
author
Saloon Keeper
Posts: 4031
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not a good practice to put images in a database because they can be quite large but if you must, lookup info about blobs/clobs.
 
anand phulwani
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Niku,

Set The Image Field in MuSQL To Blob type,and then
 
niku shah
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks anand but there is no effect in MySQL database after executing the statement.... ps.setBinaryStream....

if you know how to store image (jpg)file in tomcat's image folder and just path in database columns please let me know...
 
Paul Clapham
Sheriff
Posts: 21557
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by niku shah:
Thanks anand but there is no effect in MySQL database after executing the statement.... ps.setBinaryStream....
Of course there isn't. Just as there would be no effect on the database after executing ps.setString(1, "test"). You have to follow that by executing the PreparedStatement in the usual way.
 
anand phulwani
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's an example of it,
Hope that would be useful.
The Link
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic