update Blob field in ResultSet --URGENT
Hi,
Before install J2EE environnement, I manipulate Blob with jdbc interface:
I made a insert with the Blob field to null and after this insert I executed a "select for update" to get a updatable ResultSet and used updateBinaryStream() methode to set my file in the Blob. It works OK
Now, with J2EE environnement (Java 2 and Oracle 8 with Thin Oracle drivers 'classes12.zip')
I get a SQLException withe the same code source:
'ORA-01002: Extraction en rupture de squence '
(sorry I'm French...)
If I try to use the new Updatable ResultSet with a call:
Statement stat = aConn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_UPDATABLE);
and try after to use the same methode 'setBinaryStream()' for update Blob field I have another Exception:
'ORA-01008: Toutes les variables ne sont pas li es '
if I use a simple 'select' or
'ORA-01002: Extraction en rupture de squence '
if I use a 'select for update'
(Sorry i'm always French...)
Someone could help me!!!!!
exemples:
1)
ls_Query = "select LC_PA_NOM from PA where ID_PA_NUMERO = 449 for update";
Statement stat = aConn.createStatement();
ResultSet rs= stat.executQuery(ls_Query );
if(rs.next())
{
rs.updateBinaryStream(1,theInputStream, theInputStream.available());
rs.updateRow();
}
=> raise SQLException: ORA 1002
2)
ls_Query = "select LC_PA_NOM from PA where ID_PA_NUMERO = 449 for update";
Statement stat = aConn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_UPDATABLE);
ResultSet rs= stat.executQuery(ls_Query );
if(rs.next())
{
rs.updateBinaryStream(1,theInputStream, theInputStream.available());
rs.updateRow();
}
=> raise SQLException: ORA 1002
3)
ls_Query = "select LC_PA_NOM from PA where ID_PA_NUMERO = 449";
Statement stat = aConn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_UPDATABLE);
ResultSet rs= stat.executQuery(ls_Query );
if(rs.next())
{
rs.updateBinaryStream(1,theInputStream, theInputStream.available());
rs.updateRow();
}
=> raise SQLException: ORA 1008
Thanks a lot
Felmerien

