| To: | users@xxxxxxxxxx |
|---|---|
| Subject: | odd db2 insert behavior |
| From: | "Jason Kretzer/STAR BASE Consulting Inc." <JKretzer@xxxxxxxxxxxxxxx> |
| Date: | Mon, 3 May 2004 09:42:09 -0400 |
| Delivered-to: | mailing list users@cinjug.org |
| Mailing-list: | contact users-help@cinjug.org; run by ezmlm |
|
Good morning all, I have a class that populates a db2 database. Here is a basic sample of what I am doing. for(int i=0; i<400; i++) { stmt.executeQuery("INSERT INTO SOME_TABLE (SOME_PRI_KEY, SOME_OTHER_VALUE) VALUES ("+i+",'bob')"); connection.commit(); } First of all, how bad is the style of this? Secondly, when I insert like this and then get the contents of the table, I get something similar to this SOME_PRI_KEY SOME OTHER VALUE 385 bob 386 bob 387 bob 388 bob 389 bob 390 bob 391 bob 392 bob 393 bob 394 bob 395 bob 396 bob 397 bob 398 bob 399 bob 1 bob 2 bob 3 bob 4 bob 5 bob Anyone know why this is happening? Could it just be a timing issue? Thanks, -Jason |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Next by Date: | RE: [cinjug-users] odd db2 insert behavior, James Carman |
|---|---|
| Next by Thread: | RE: [cinjug-users] odd db2 insert behavior, James Carman |
| Indexes: | [Date] [Thread] [Top] [All Lists] |