https://issues.apache.org/bugzilla/show_bug.cgi?id=47036

           Summary: java.lang.ClassCastException:
                    org.apache.tomcat.dbcp.dbcp.DelegatingResultSet
           Product: Tomcat 5
           Version: 5.5.27
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: ydkal...@gmail.com
                CC: ydkal...@gmail.com


java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.DelegatingResultSet

i am facing this exception while doing the upload file functionality

please find the code which i am using for storing the binary information in the
table

kindly give me any solution to overcome this issue. thanks in advance

private void storeBlob(Connection con, long lngNattId, InputStream input,long
nboId) throws SQLException, IOException {

 PreparedStatement pStmt = null;
 ResultSet rs = null;
 OutputStream out = null;
 pStmt = con.prepareStatement("SELECT * FROM  ATTACHMENT WHERE ATT_ID = ? FOR
UPDATE ");
 pStmt.setLong(1, lngNattId);
 rs = pStmt.executeQuery();
 rs.next();

 DelegatingResultSet dRS = (DelegatingResultSet) rs;
 OracleResultSet oRS = (OracleResultSet) dRS.getInnermostDelegate();
 out = (oRS.getBLOB("NATT_BIN_FILE")).getBinaryOutputStream();

 byte[] buffer = new byte[32768];
 int n = 0;
 while ((n = input.read(buffer)) != -1) {
  out.write(buffer, 0, n);
 }
 out.flush();
 con.commit();
}

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to