| Author |
Images in Microsoft SQL server 2005
|
Kunal Lakhani
Ranch Hand
Joined: Jun 05, 2010
Posts: 609
|
|
|
I have got a project on FIR management, and i have to store & retrieve images with their respective Ids. How can we store images & retrieve them in Microsoft SQL server 2005??
|
kunal
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
Use a suitable LOB data type. The (SQL Server specific) image data type would be a good choice.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Kunal Lakhani
Ranch Hand
Joined: Jun 05, 2010
Posts: 609
|
|
|
thanks Paul. Can you provide some details?? or any notes??
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
An explanation of the data type can be found in the SQL Server documentation. What else do you need to know?
|
 |
Kunal Lakhani
Ranch Hand
Joined: Jun 05, 2010
Posts: 609
|
|
|
I need to know process of inserting and retrieving images from SQL.
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
There's no real magic here. You just write an insert statement and pass the binary stream of your image. If you were to do it dirtectly in SQL Server you would use Transact SQL to do this (see the docs I mentioned earlier), but I'm guessing you want to ultimately do this with JDBC?
|
 |
Kunal Lakhani
Ranch Hand
Joined: Jun 05, 2010
Posts: 609
|
|
|
yes. i want to do it with jdbc. will it cause any problem?
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
Nope. It's actually easier just with JDBC. Stream your image (however you are doing that) then bind it as binary stream. See PreparedStatement JavaDocs for more.
|
 |
Kunal Lakhani
Ranch Hand
Joined: Jun 05, 2010
Posts: 609
|
|
|
Paul, please provide code examples
|
 |
Kunal Lakhani
Ranch Hand
Joined: Jun 05, 2010
Posts: 609
|
|
No reply!!!
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26201
|
|
Kunal Lakhani wrote:No reply!!!
PatienceIsAVirtue - remember that you could need to wait up to 24 hours before someone sees your message due to work/sleep/life patterns. Bumping posts before that is highly discouraged.
|
[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
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26201
|
|
Kunal Lakhani wrote:Paul, please provide code examples
See The JDBC tutorial examples.
|
 |
 |
|
|
subject: Images in Microsoft SQL server 2005
|
|
|