It should be 3 requests. If the tables are in a parent/child relationship, you need to add the parent first.
An alternative: enclose the inserts in a transaction (begin/commit or rollback). That way, if somethig goes wrong you won't have a partially-correct database.
-Java Guy
-----Original Message-----
From: "sreekanth" <sreekanth.816@
Subj: [Java] JDBC executeBatch(
Date: Thu Feb 18, 2010 1:36 pm
Size: 10K
To: Java_Official@
Hi all,
Statement stmt = con.createStatement
first(...)")
second(...)"
stmt.executeBatch(
I am using above code to insert data into 3 tables at a time.
When i call stmt.executeBatch(
requests (calls) will go to database to insert data into tables or with
single request (call) data will insert into 3 tables?
Note: my application is in my system and database is at remote location.
[Non-text portions of this message have been removed]
Java Official Group is created for the following topics: Java 2 Enterprise Edition - J2EE, Java 2 Standard Edition - J2SE, Java 2 Micro Edition - J2ME, XML, XSL, XSD, XPATH, Web Services, Jini, JXTA for all type of Java Geeks.
Whoever posts spam / ads / job related message will be BANNED IMMEDIATELY
No comments:
Post a Comment