I want to insert into some tables some values. I have an arrayList of the table information. I want to loop through this arrayList and insert values to diff tables. What should the string query be like?
For Eg:-
insert into accounts(id,balance) values(1,78900);
insert into customers(name,balance) values('bailey',9000);
insert into savings(name,remaining_balance) values('sean',8900.90);
I was thinking something like:-
String stmt = "Insert into %s (%s) values(%s)";
I am not sure this is the right insert statement in String. Do we have to use some regular expression ?
I am a beginner in Java and dbms so please be kind.