Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Servlet Interest »

Re: How to show an image when fetching from database

Zutshi, Rahul

2004-09-29


RE: How to show an image when fetching from database

Refer to Paul Copeland's response to a similar question earlier. Subject of the response being "Re: How To Insert Image Into Mqsql data type ?(urgent)"

gl,
Rahul

-----Original Message-----
From: andy susanto [mailto:andy78@CENTRIN.NET.ID]
Sent: Wednesday, September 29, 2004 8:44 AM
To: SERVLET-INTEREST@JAVA.SUN.COM
Subject: How to show an image when fetching from database


hai,

this is my partial code :

Statement stmt = Con.createStatement();
  ResultSet resultSet = stmt.executeQuery("SELECT PIC FROM TransTreatment");

  byte[] test = new byte[4096];
  res.setContentType("image/jpeg");
  while (resultSet.next()) {
    // Get data from the binary column
    test = resultSet.getBytes("PIC");
  }

how to finish my code, i would like show an image  using IMG TAG, but i do not how to implement that, btw is that ok for my code that i use getBytes() Method or is there a good Method beside that


TIA,

andy

___________________________________________________________________________
To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________ To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

©2008 junlu.com - Jax Systems, LLC, U.S.A.