This discussion is archived
0 Replies Latest reply: Dec 6, 2011 10:05 AM by 866724 RSS

OrdHttpResponseHandler problem [screens]

866724 Newbie
Currently Being Moderated

So, i have following java code which was written in JSP :
<%@page import=""%>
<%@page import=""%>
<%@page import=""%>
<%@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 ( {
                    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 :


  • Correct Answers - 10 points
  • Helpful Answers - 5 points