Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

running queries in loop

Thread view: 
dbuser - 15 Mar 2006 21:01 GMT
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);
    }
hussainak@gmail.com - 15 Mar 2006 22:15 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.