This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How do I save a picture in database??" Watch "How do I save a picture in database??" New topic

How do I save a picture in database??

Nadia Marques

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?
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
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: How do I save a picture in database??
It's not a secret anymore!