title: How to make a query string for postgresQL with all fields variable in Java?
body: <p>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?</p>
  <p>For Eg:-</p>
  <pre><code>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);
  </code></pre>
  <p>I was thinking something like:-</p>
  <pre><code>String stmt = &quot;Insert into %s (%s) values(%s)&quot;;
  </code></pre>
  <p>I am not sure this is the right insert statement in String. Do we have to use some regular expression ?</p>
  <p>I am a beginner in Java and dbms so please be kind.</p>