Skip site navigation (1) Skip section navigation (2)

Re: I forgot the "Begin" command, what should I do ?

From: "Chris Smith" <cdsmith(at)twu(dot)net>
To: "Waldomiro" <wmiro(at)shx(dot)com(dot)br>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: I forgot the "Begin" command, what should I do ?
Date: 2004-02-21 15:41:55
Message-ID: 09a601c3f891$3c8f5a80$6f00000a@KYA (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Waldomiro wrote:
> A few days ago, I wrote a program that updates some tables, but I
> forgot the "begin" and the "commit".
> Is there a way to throws an exception when I update a table without
> the "begin" command ?
> It would be interesting because the Database will show I forgot a
> command.

You're better off not issuing 'begin' or 'commit' commands in SQL anyway.
JDBC is designed to do those kinds of things using methods on the Connection
class.  Nevertheless, if you're issuing them by hand and issue a commit
without a corresponding 'begin' or some such, the warning that results will be
available through the Statement's getWarnings() method.

The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

In response to

pgsql-jdbc by date

Next:From: as1024Date: 2004-02-23 00:32:25
Subject: Question about java
Previous:From: Chris SmithDate: 2004-02-21 15:17:11
Subject: Re: PATCH: SSL documentation and flexibility

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group