X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id C9F6F9DCC70 for ; Mon, 27 Feb 2006 18:14:30 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13773-03 for ; Mon, 27 Feb 2006 18:14:32 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by postgresql.org (Postfix) with SMTP id 617429DCC48 for ; Mon, 27 Feb 2006 18:14:28 -0400 (AST) Received: (qmail 11006 invoked by uid 1112); 27 Feb 2006 22:14:30 -0000 Date: Mon, 27 Feb 2006 17:14:30 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: =?iso-8859-1?Q?Bj=F6rn_Bergenheim?= cc: pgsql-jdbc@postgresql.org Subject: Re: How to get batch commands to work In-Reply-To: <00d101c63b30$aa7a2b40$635a59d5@plyschmanxp> Message-ID: References: <00d101c63b30$aa7a2b40$635a59d5@plyschmanxp> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-517314913-1141078470=:283" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.116 required=5 tests=[AWL=0.116] X-Spam-Score: 0.116 X-Spam-Level: X-Archive-Number: 200602/174 X-Sequence-Number: 14771 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-517314913-1141078470=:283 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Mon, 27 Feb 2006, Bj=F6rn Bergenheim wrote: > Hello all, I have tried to check out the archive since this seems like a= =20 > question I shouldnt be the first to ask, but I have come up with=20 > nothing. I'm doing a massive insert batch, and thought that you could=20 > add a few insert to a batch, and then execute the batch, and then=20 > continue adding more inserts, and then run the batch, and so on.=20 > However, when I try to do this, I get an exception when I try to=20 > populate my prepared statement after I have run the executeBatch() for=20 > the first time. The eception I get is "Parameter index out of range": > This should work fine as the attached test does for me. Can you show us a= =20 complete example of something that fails? Kris Jurka --0-517314913-1141078470=:283 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=BatchTest.java Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=BatchTest.java aW1wb3J0IGphdmEuc3FsLio7DQoNCnB1YmxpYyBjbGFzcyBCYXRjaFRlc3Qg ew0KDQoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nIGFyZ3NbXSkg dGhyb3dzIEV4Y2VwdGlvbiB7DQoJCUNsYXNzLmZvck5hbWUoIm9yZy5wb3N0 Z3Jlc3FsLkRyaXZlciIpOw0KCQlDb25uZWN0aW9uIGNvbm4gPSBEcml2ZXJN YW5hZ2VyLmdldENvbm5lY3Rpb24oImpkYmM6cG9zdGdyZXNxbDovL2xvY2Fs aG9zdDo1NDMyL2p1cmthIiwianVya2EiLCIiKTsNCgkJY29ubi5zZXRBdXRv Q29tbWl0KGZhbHNlKTsNCgkJU3RhdGVtZW50IHN0bXQgPSBjb25uLmNyZWF0 ZVN0YXRlbWVudCgpOw0KCQlzdG10LmV4ZWN1dGUoIkNSRUFURSBURU1QIFRB QkxFIHQgKGEgaW50IHByaW1hcnkga2V5KSIpOw0KDQoJCVByZXBhcmVkU3Rh dGVtZW50IHBzID0gY29ubi5wcmVwYXJlU3RhdGVtZW50KCJJTlNFUlQgSU5U TyB0IFZBTFVFUyAoPykiKTsNCgkJcHMuc2V0SW50KDEsMSk7DQoJCXBzLmFk ZEJhdGNoKCk7DQoJCXBzLnNldEludCgxLDIpOw0KCQlwcy5hZGRCYXRjaCgp Ow0KCQlwcy5leGVjdXRlQmF0Y2goKTsNCgkJcHMuc2V0SW50KDEsMyk7DQoJ CXBzLmFkZEJhdGNoKCk7DQoJCXBzLmV4ZWN1dGVCYXRjaCgpOw0KCQlwcy5j bG9zZSgpOw0KDQoJCVJlc3VsdFNldCBycyA9IHN0bXQuZXhlY3V0ZVF1ZXJ5 KCJTRUxFQ1QgYSBGUk9NIHQiKTsNCgkJd2hpbGUgKHJzLm5leHQoKSkgew0K CQkJU3lzdGVtLm91dC5wcmludGxuKHJzLmdldEludCgxKSk7DQoJCX0NCgl9 DQp9DQo= --0-517314913-1141078470=:283--