This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How do I save a picture in database?? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "How do I save a picture in database??" Watch "How do I save a picture in database??" New topic
Author

How do I save a picture in database??

Nadia Marques
Greenhorn

Joined: Nov 17, 2005
Posts: 1
Helo!! I have a picture in the JPanel and I need to save it in a database. How can I do this?
Nadia
Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078
This probably belongs in JDBC forums.

You should be able to open a Connection and open a binary stream you can write to using a PreparedStatement. In our database we store images as blobs and upload them with this methodology. Unfortunately the source isn't something I can post here, but that should give you an idea of where to look.
Casper Maxwell
Ranch Hand

Joined: Aug 04, 2005
Posts: 88
You may check this tip:

How to store/retrieve image to/from SQLServer
http://www.java-tips.org/content/view/203/29/


<a href="http://computer-engineering.science-tips.org" target="_blank" rel="nofollow">Computer Engineering</a>, <a href="http://civil-engineering.science-tips.org" target="_blank" rel="nofollow">Civil Engineering</a>, <a href="http://medicine.science-tips.org" target="_blank" rel="nofollow">Medicine</a> Tips.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How do I save a picture in database??
 
Similar Threads
Saving a picture of an applet
manage the picture file
save random numbers
Image location in the server?
image uploading in order to save to database