This content has been marked as final.
Show 3 replies
-
1. Re: JBOSS, JDBC, and BLOBs
oberkom Jul 6, 2004 8:55 AM (in response to wmallian)I had a similar problem, i used a binary stream to load the images at the database, like:
PreparedStatement prepStmt = null; try { makeConnection(); String strInsertSQL = "INSERT INTO TABLEBLO (BLOINTNUM,BLO__FILE) VALUES (?,?)"; prepStmt = con.prepareStatement(strInsertSQL); strIdentifier = getId(); // Getting new id prepStmt.setString(1,strIdentifier); ByteArrayInputStream bais = new ByteArrayInputStream(arrayArchivo); prepStmt.setBinaryStream(2, bais,arrayArchivo.length); prepStmt.executeUpdate(); bais = null; strInsertSQL = null; } catch (Exception e) { <whatever> ); } finally { prepStmt.close(); closeConnection(); }
I hope this helps you -
2. Re: JBOSS, JDBC, and BLOBs
wmallian Jul 6, 2004 2:27 PM (in response to wmallian)well, i tried your implementation, but i'm still limited to 2k. if my file is under 2k it inserts no problem, over 2k it doesnt insert.
what is your variable arrayArchivo ??? is that a byte[] array ??
you are using the Oracle thin client along with Oracle 9 ??? -
3. Re: JBOSS, JDBC, and BLOBs
oberkom Jul 7, 2004 4:26 AM (in response to wmallian)Correct,
arrayArchivo its the file byte array i want to load into database... Iam using Oracle 8.1.7. to load that blob into a LONG RAW field....