wood burning stoves*
The moose likes JDBC and the fly likes store image using sql server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "store image using sql server" Watch "store image using sql server" New topic

store image using sql server

Es Tan

Joined: Jul 05, 2006
Posts: 2
i am the beginner of jsp and like to know which is the best data type to store the image and how to retrieve the image from sql server 2000.
thank you.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299

This has nothing to do with JSPs. Moving to our JDBC forum...

GenRocket - Experts at Building Test Data
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30146

Welcome to JavaRanch!

You can store the image in a BLOB object. Search for "Blob" in this forum or the Sun JDBC tutorial for an example.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Es Tan

Joined: Jul 05, 2006
Posts: 2
Thanks Jeanne. But the sql server doesn't support blob data type. I try to store in image type but don't know how to retrieve in jsp page.
Scott Johnson
Ranch Hand

Joined: Aug 24, 2005
Posts: 518
SQL Server's image datatype is a blob.

As Jeanne suggested, take a look at the Sun JDBC tutorial for an example. The Java API javadoc will be helpful as well.
wood burning stoves
subject: store image using sql server
Similar Threads
how to store an image object in the database
JDBC to SQL Server
put image into database
storing and retriveing image through Ms-sql
Fetching Image Data