This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes inserting an image in to the data base Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "inserting an image in to the data base" Watch "inserting an image in to the data base" New topic
Author

inserting an image in to the data base

yugandhar channagiri
Greenhorn

Joined: Mar 10, 2008
Posts: 8
can you help me in finding out solution for inserting an image in to the database ?? and also give me sample code for this problem........
Anubhav Anand
Ranch Hand

Joined: May 18, 2007
Posts: 341

Originally posted by yugandhar channagiri:
can you help me in finding out solution for inserting an image in to the database ?? and also give me sample code for this problem........


Did you care to give it a try yourself. Just a deep breath .....Google or some random ideas.

Asking for the code doesn't really make sense, if you don't care to give the problem a try by yourself.

Anyway, few hints are you can store image as a BLOB, or simply opening a binaryinputstream.

Another way is, if you are sure that the file will remain on server then, you can just store the URI of file and retrieve the file with the help of URI.
yugandhar channagiri
Greenhorn

Joined: Mar 10, 2008
Posts: 8
thank you for your immediate response,the problem here is it is inserting in to the database but it became a over head for me in the case of retriving.i,e the is not showing
Anubhav Anand
Ranch Hand

Joined: May 18, 2007
Posts: 341

Originally posted by yugandhar channagiri:
thank you for your immediate response,the problem here is it is inserting in to the database but it became a over head for me in the case of retriving.i,e the is not showing


does that mean that you are able to save successfully but facing problems while retrieving i.e while displaying back??

well then after you get the resultset try something like,




Hope that helps.
yugandhar channagiri
Greenhorn

Joined: Mar 10, 2008
Posts: 8
yes problem with the retriving
ya good the code is working.........................
 
 
subject: inserting an image in to the data base
 
Similar Threads
checkbox
Insert Image/jpg files into MS Database
Inserting an image to Jframe and save it , in SQL database
jsf or ice faces
Inserting images in to the database