File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 15302

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

GenRocket - Experts at Building Test Data
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32819

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.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, 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.
I agree. Here's the link:
subject: store image using sql server
jQuery in Action, 3rd edition