Results 1 to 4 of 4
Thread: How to save image in database
- 08-02-2010, 08:59 AM #1
Member
- Join Date
- Aug 2010
- Posts
- 5
- Rep Power
- 0
- 08-02-2010, 11:02 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Presumably it's an input stream you get, so feed that stream into the setBinaryStream() method of a PreparedStatement, for the correct column. This of course assumes that you aready have a table with the correct column in it.
- 08-02-2010, 11:34 AM #3
Member
- Join Date
- Jun 2010
- Location
- Bangalore,India
- Posts
- 70
- Rep Power
- 0
You should have column data type as blob in the database.
Then use the following code to set as binary stream
pstmt.setBinaryStream(1, istream, (int) (fImage.length()));Arun K R,Bangalore,India
:)
- 08-02-2010, 12:02 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Similar Threads
-
Save JTable to database
By Geraldo in forum AWT / SwingReplies: 0Last Post: 06-04-2010, 02:03 PM -
how to save image as jpg?
By katie in forum New To JavaReplies: 4Last Post: 04-15-2010, 10:07 AM -
how can i save an image from url
By happyday in forum Advanced JavaReplies: 2Last Post: 01-14-2009, 07:02 PM -
Save a jpg image on server
By yadavjpr in forum Java ServletReplies: 1Last Post: 11-21-2008, 01:49 PM -
save file to database
By katerinaaa in forum New To JavaReplies: 0Last Post: 08-14-2007, 12:15 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks