| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> OCCI: how to do a BATCH UPDATE?
Hello,
I would like to use Oracle's OCCI to send
a BATCH UPDATE (known form JDBC) to the
DBMS. It seems that OCCI is not able to
do it like JDBC.
How can I do a BATCH UPDATE with OCCI?
I know there is a addIteration() in the
interface of the OCCI Statement, but in
my opinion this is not the appropriate
operation. It's only iterating parameters
of a Parameterized Statement but I need to
change the SQL string in every batch line
(without calling executeUpdate).
Please have a look to the following JDBC example to see, what I want to do:
class test {
...
private static void doBatch (Connection con)
throws SQLException
{
String s1 = "INSERT INTO ...";
String s2 = "UPDATE ... SET ...";
String s3 = "DELETE ...";
con.setAutoCommit(false);
Statement stmt = con.createStatement();
System.out.println("Adding batch: "+s1+"\n");
stmt.addBatch(s1);
System.out.println("Adding batch: "+s2+"\n");
stmt.addBatch(s2);
System.out.println("Adding batch: "+s3+"\n");
stmt.addBatch(s3);
System.out.println("Executing batch ...\n");
int [] updateCounts = stmt.executeBatch();
for(int i=0; i<updateCounts.length; i++)
System.out.println("Count["+i+"]="+updateCounts[i]);
System.out.println("Done.\n");
stmt.close();
...
}
How can I do this in OCCI?
Could you please help me?
Thank you,
Andreas.
Received on Wed Mar 13 2002 - 08:04:35 CST
![]() |
![]() |