hi,

i'm working with JSP and servlets

is there a simple way, method, ....  or something
to STORE and RETRIEVE images (gif or jpg) from an Oracle database
using JSP, JWEB, ...

i have been trying with BLOB's,
so far: no success

is there anyone how had the same problem
(or, even better, a solution)



This is my temporary solution
maybe someone can see what's missing?

table blobs, 2 columns: ID (varchar2)
                                                BLOB_COL (blob)

db = class for making connection to database
{
   String sql = "SELECT * FROM BLOBS";
    ResultSet rs = null;
    PreparedStatement ps = null;
    Connection conn = null;

    try{
      db.connect();
      conn = db.getConn();
     }
     catch(Exception e){ System.out.println("fout" + e);}

    try{
      rs = db.execSQL(sql);
    }
    catch(SQLException e){System.out.println("fout" + e);}

    try{
      while(rs.next()) {
        System.out.println(rs.getString(1));    shows ID
        System.out.println(rs.getString(2));            PROBLEM: shows null,
even when there is a blob inserted

HOW CAN I CONVERT THIS TO AN IMAGE??????
      }

    rs.close();
    db.close();
    }
    catch(Exception e){System.out.println("fout" + e);}
  }
}

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to