Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COMMONS DBCP error with TOMCAT_5.0.28 /JMV (1.5.0_06)

Status
Not open for further replies.

jayjay69

Programmer
Oct 10, 2008
1
IT
Hi,
I'm developing on: JDeveloper 10 /Oracle database 10g
I'm using the following code to insert a file in a blob and works good:

................
if (record.next()) {
BLOB blob = ((OracleResultSet)(record)).getBLOB("file_blob");
System.out.println("Start coping file into Blob");
System.out.println("Attached length = " + this.getUploadedFile().length());
FileInputStream instream = new FileInputStream(this.getUploadedFile());
System.out.println("Before getBinaryOutputStream");
OutputStream outstream = blob.setBinaryStream(0);
System.out.println("After getBinaryOutputStream");

int chunk = blob.getChunkSize();
byte[] buffer = new byte[chunk];
int length = -1;

while ((length = instream.read(buffer)) != -1) {
outstream.write(buffer, 0, length);
}
instream.close();
outstream.close();
conn.commit();
} else {
try {
conn.rollback();
System.out.println("Nessun record passato .... nessun file");
} catch (SQLException sqle) {
throw new SocietaException(sqle.getMessage());
} catch (NullPointerException ne) {
throw new SocietaException(ne.getMessage());
}
}
} catch (Exception e) {
System.out.println(e.getMessage());
try {
conn.rollback();
} catch (SQLException sqle) {
throw new SocietaException(sqle.getMessage());
} catch (NullPointerException ne) {
throw new SocietaException(ne.getMessage());
}
throw new SocietaException((e.getMessage().indexOf("ORA-00001") >= 0) ? Utilita.getMessage("errore.carica.esiste") : Utilita.getMessage(e.getMessage()));
} finally {
if (c != null)
c.close(pstmt);
c.close(stmt);
}

BUT WHEN I TRY TO BRING ALL TO TOMCAT_5.0.28 /JMV (1.5.0_06) I get this error:
"NOT FOUND: org.apache.commons.dbcp.DelegatingResultSet".

What can I do to solve this problem?
Thanks a lot.
J.J
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top