From derby-user-return-1313-apmail-db-derby-user-archive=db.apache.org@db.apache.org Wed May 25 07:39:10 2005 Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 31669 invoked from network); 25 May 2005 07:39:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 May 2005 07:39:10 -0000 Received: (qmail 28446 invoked by uid 500); 25 May 2005 07:39:08 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 28422 invoked by uid 500); 25 May 2005 07:39:07 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 28403 invoked by uid 99); 25 May 2005 07:39:07 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from brmea-mail-4.Sun.COM (HELO brmea-mail-4.sun.com) (192.18.98.36) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 25 May 2005 00:39:05 -0700 Received: from phys-epost-1 ([129.159.136.14]) by brmea-mail-4.sun.com (8.12.10/8.12.9) with ESMTP id j4P7d30R024959 for ; Wed, 25 May 2005 01:39:03 -0600 (MDT) Received: from conversion-daemon.epost-mail1.sweden.sun.com by epost-mail1.sweden.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <0IH100501BLZ3V@epost-mail1.sweden.sun.com> (original mail from Bernt.Johnsen@Sun.COM) for derby-user@db.apache.org; Wed, 25 May 2005 09:39:02 +0200 (MEST) Received: from clustra.norway.sun.com (clustra.Norway.Sun.COM [129.159.113.10]) by epost-mail1.sweden.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with SMTP id <0IH1000PRBX2HL@epost-mail1.sweden.sun.com> for derby-user@db.apache.org; Wed, 25 May 2005 09:39:02 +0200 (MEST) Received: (qmail 29238 invoked from network); Wed, 25 May 2005 07:39:02 +0000 Received: from atum01.norway.sun.com (129.159.112.201) by clustra.norway.sun.com with QMQP; Wed, 25 May 2005 07:39:02 +0000 Date: Wed, 25 May 2005 09:39:02 +0200 From: "Bernt M. Johnsen" Subject: Re: Multiple SQL statements in a script fail using JDBC In-reply-to: <4293710B.5020501@pacbell.net> To: Derby Discussion Message-id: <20050525073902.GC20629@atum01.norway.sun.com> Organization: Sun Microsystems MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.5.9i References: <4293710B.5020501@pacbell.net> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N >>>>>>>>>>>> Andrew wrote (2005-05-24 11:23:07): > [snip] > How can I give Derby a list of SQL statements from a script and it will > execute them, other than me parsing out SQL statement one prior to > calling the statement.execute(). >From JDBC you can't. You have either to execute the statements one by one, or use the batch, but still tou have to add the statements one by one to the batch (statement.addBatch() and statement.executeBatch()). > I would like the database creation to be embedded into this Java > application. Is there a utility to execute these scripts using a Java > Connection Object? Not through a connection object. You can, however, consider using the tool ij to execute a script of SQL statements. > Also, what is the Derby SQL term used to COMMIT a transaction, it is not > "COMMIT" In JDBC: connection.commit(); In ij: COMMIT; -- Bernt Marius Johnsen, Database Technology Group, Sun Microsystems, Trondheim, Norway