Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Insert multiple rows of records into the database

843841Jun 11 2003 — edited Jun 12 2003
The codes below allow me to insert a row of record into the database. How would I changed these to insert multiple rows at once? Please help!

String sql = "INSERT INTO EMPLOYEES" +
"(First_Name, Last_Name, Title, Phone) " +
" VALUES " +
"(?,?,?,?)";

PreparedStatement statement = conn.prepareStatement(sql);

statement.setObject (1, First_Name);
statement.setObject (2, Last_Name);
statement.setObject (3, Title);
statement.setObject (4, Phone);

boolean returnValue = statement.execute();
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 10 2003
Added on Jun 11 2003
3 comments
229 views