I am using the following code in the page "image.jsp", to output an image from a DataBase. 
 
<img src="image.jsp">
 
The approach works fine, except that the byte array that I get from the DataBase has the maximum size of 16kb (exactly 16384=16*1024bytes).
 
I am using:
MSSQL server
IDS server for jdbc/odbc bridge
JRun webserver (JSP 1.0)
JDK 1.2.1
 
The big questtion is "WHERE DOES THE FIELD GET TRUNCATED???"
 
 
Ps.  Except for that, I find this a great way to output images from DBMS's, if anyone is concerned
 
 
***************************************
 
<%
        conn = java.sql.DriverManager.getConnection(dburl);
        stmt = conn.createStatement();
        rs = stmt.executeQuery(sqlSelect);
        if (rs.next()) {
            bytes = rs.getBytes("image_value");
        }
        if (bytes != null) {
            response.getOutputStream().write(bytes,0,bytes.length);
        }
%>

Reply via email to