How to insert a date variable in java?

How to insert and retrieve image in MSSQL by using java?

  • I am trying to make a simple application by using java and MSSQL but i don't know how to insert the image in SQL by using java. I search on the net but I didn't succeed. I am stack by this on my application and cannot move further. So, Please help me on this.

  • Answer:

    dont store the image in the db, but just store the link (example: C:\Image\someImage.png) just read the link when u need it and display image from there hope this helps you

anamol at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

It's better not to store images or other large BLOBs in the dartabase itself if you can help it for 3 reasons: 1) it wastes tablespace 2) the bloated rowsize slows down queries 3) you can't do any sort of searching against it in a WHERE Instead, create a folder somewhere and store the binary data there while just storing the path to it in the database. Then after retrieving the path, getting the image itself is a trivial second step.

TheMadProfessor

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.