Hi Friends
i am stuck in a problem for which i need your help.i will brief you about the issue below.
I am having Multiple Insert Statements which i need to execute to put the data in the database.i have a doubt about the use of the executeUpdate() function in the statement interface. sample code is as below.
stmt = conn.prepareStatement("INSERT INTO Client ( clientPk, provincePk, countryPk, statusPk, branchPk, salutation, ) VALUES(PID, 2, '123123123', '123', '66', 1, 1 );");
int n =stmt.executeUpdate();
Now the problem is how do i insert multiple Insert statements using the conn.prepareStatement().should i do like
stmt = conn.prepareStatement("")
int n =stmt.executeUpdate();
stmt = conn.prepareStatement("")
int n =stmt.executeUpdate();
stmt = conn.prepareStatement("")
int n =stmt.executeUpdate(); ..................................
should i use the same steps to execute each individual query and then use executeUpdate().
Please let me know the correct procedure to be followed to execute these tasks.waiting for a positive reply from your side.
Thanks & Regards
Vikram K
i am stuck in a problem for which i need your help.i will brief you about the issue below.
I am having Multiple Insert Statements which i need to execute to put the data in the database.i have a doubt about the use of the executeUpdate() function in the statement interface. sample code is as below.
stmt = conn.prepareStatement("INSERT INTO Client ( clientPk, provincePk, countryPk, statusPk, branchPk, salutation, ) VALUES(PID, 2, '123123123', '123', '66', 1, 1 );");
int n =stmt.executeUpdate();
Now the problem is how do i insert multiple Insert statements using the conn.prepareStatement().should i do like
stmt = conn.prepareStatement("")
int n =stmt.executeUpdate();
stmt = conn.prepareStatement("")
int n =stmt.executeUpdate();
stmt = conn.prepareStatement("")
int n =stmt.executeUpdate(); ..................................
should i use the same steps to execute each individual query and then use executeUpdate().
Please let me know the correct procedure to be followed to execute these tasks.waiting for a positive reply from your side.
Thanks & Regards
Vikram K