running queries in loop

D

dbuser

Hello gurus,
I am trying to get insert query name and insert xml doc in tokens from
the properties file and run the jdbc queries in sequence. I am trying
to do using Tokenizer class, Can you pls suggest if this is the right
way of doing it or not? I would like to do it using List so that I
have better control over elements of it. any suggestion? Thanks alot !


String insertSQL = prop.getProperty("insert.sql");
String insertDOC = prop.getProperty("insert.doc");
StringTokenizer st1 = new StringTokenizer(insertSQL, " ");
StringTokenizer st2 = new StringTokenizer(insertDOC, " ");
String iQuery=null;
String iDoc=null;
while (st1.hasMoreTokens() && st2.hasMoreTokens()) {
iQuery = st1.nextToken();
iDoc = st2.nextToken();
insertQuery(iQuery, iDoc, ,conn);
}
 
H

hussainak

thts a bad practice.....

juss load the results in an array, close the connection...then run a
for loop on the array to retrieve the results or perform any operations
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top