Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

storing and retrieving image files in mysql using jsp

Status
Not open for further replies.

murushanmugham

IS-IT--Management
Jan 2, 2003
33
0
0

we want codes for storing and retreiving the image files in mysql using jsp.please give your suggestion and help us.
 
Please remember that this site IS NOT a paid support site for you - and as such will not generally write you entire solutions.

Look into JDBC for talking to MySQL from JSP.
A hint - you will need to convert the images to a byte[] array, and store them in a BLOB field.

Feel free to come back when you wish for help on some specific error, or code.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
I'm trying to save and retrieve status for a submitted form on a JSP. Retrieving textbox answers is relatively simple but for selection boxes I'm doing this:

<%String countryDB = rs.getString("countryDB"); %> //get value last submitted

<td valign="TOP" height="21" colspan="3"> //now try and re-select it.
<select name="country" >
<option value="" >Pull down to select
<option value="Afghanistan" <%if (country.equals("countryDB")) {%> selected <%} %>>Afghanistan</option>
<option value="Albania" <%if (country.equals("countryDB")) {%> selected <%} %>>Albania</option>
<option value="Algeria"<%if (country.equals("countryDB")) {%> selected <%} %>>Algeria</option>
...etc...etc

</td>

Is there an easier way to write this without having to add the "<%if (country.equals("countryDB")) {%> selected <%} %>" for the hundred countries.
The above works and you could probably do it using javaScript with the onLoad function to cycle through the values of the form, but I was curious what the best way to go about this might be. Any suggestions? Thanks JW.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top