0 Replies Latest reply: Dec 6, 2011 12:05 PM by 866724 RSS

    OrdHttpResponseHandler problem [screens]


      So, i have following java code which was written in JSP :
      <%@page import="oracle.ord.im.OrdHttpJspResponseHandler"%>
      <%@page import="oracle.ord.im.OrdHttpResponseHandler"%>
      <%@page import="oracle.ord.im.OrdImage"%>
      <%@page import="oracle.jdbc.OracleResultSet"%>
      <%@page import="java.sql.PreparedStatement"%>
      <%@page contentType="text/html" pageEncoding="UTF-8"%>
      <%@page import="OracleConn.OracleConnection" %>
      <!DOCTYPE html>
              <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
              <title>Biblioteka muzyczna</title>
              <link rel="stylesheet" type="text/css" href="css/style.css"/>
              <h1>IMAGE :</h1>
                  OracleConnection conn = new OracleConnection();
                  try {
                      String query = "select plikimage from testimage where id=2";
                      PreparedStatement pstmt = conn.polaczzBaza().prepareStatement(query);
                      OracleResultSet rset2 = (OracleResultSet) pstmt.executeQuery();
                      if (rset2.next()) {
                          OrdImage imgProxy = (OrdImage) rset2.getORAData("plikimage", OrdImage.getORADataFactory());
                          OrdHttpResponseHandler handler = new OrdHttpResponseHandler(request, response);
                          handler.sendResponse(imgProxy.getMimeType(), imgProxy.getContentLength(), imgProxy.getContent(), imgProxy.getUpdateTime());
                          //Next solution below
                          //OrdHttpJspResponseHandler handler2 = new OrdHttpJspResponseHandler();
                      } else {
                  } catch (Exception e) {
      So, code works i mean it shows only the image which was loaded from database. I would like to change code in this way, that i would able to add some other stuff to the website.

      Screen :