• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

Uploading an image to sql server

Hi, Im looking to upload a file into an sql server by posting my jsp to a servlet. Is there anywhere I can find what datatypes need to be setup in the DB and how I can them from the request in the servlet?

Im also looking to retrieve them as well so need some method of reconstructing the image when I get it back from the DB via another servlet.

Any advice?
0
Chriseybaby
Asked:
Chriseybaby
2 Solutions
 
bloodredsunCommented:
You'll need to store it as a BLOB.

Insertion and retrieval is fairly simple, see here http://www.informit.com/guides/printerfriendly.asp?g=java&seqNum=166&rl=1
0
 
ChriseybabyAuthor Commented:
Yes I can do it ok in mysql, but cant seem to find out how to do it in sql server. It has an image data typre, but not a blob, as far as I can see.
0
 
colr__Commented:
In my past expereience, Ive never been able to get file uploads to work between SQL Server and non-microsoft languages. For example, Ive tried uploading from java to SQL server and couldnt get it to work, although I could get it no probs using ASP or .NET (we had several developers at oiur end try rthis seperatly and couldnt get it even close).

I think MS have deliberatly made it hard to do - its a kind of lock-in to MS technology.

colr__
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now