Thanks - should have thought of looking in those logs! So much for our
exception handling/reporting at that point.
Anyway - now resolved, with my thanks.
I do however have an additional query!
In 7.3 (using the 7.3 JDBC driver) we were able to do the following:
=== SNIP ===
if (value == null)
stmt.setString( index, null );
=== END ===
Some context here. We have a method that constructs a PreparedStatement
taking the sql (eg):
UPDATE table SET cola = ?, colb = ?, colc = ?
INSERT INTO table (cola, colb, colc) VALUES (?, ?, ?)
And an Object of values (in the correct order) for the sql being used in
Now - the reason we do a setString(index, null) and not a setNull(index,
Types.SOME_TYPE) is because this method is generic and does not always KNOW
the datatypes for the columns.
Now, using PostgreSQL 8 (and the new JDBC driver for 8) we ARE still able to
do that when using a 7..3 db server, but get the following error when using
a version 8 PGSQL server:
ERROR: column "created_by" is of type integer but expression is of type
Where created_by is being passed a NULL value (using the setString(index,
Does anyone have any comments/suggestions/etc? Is there any way to get
around this? Or will we need to update our side to always pass in the
column meta data etc for use?
Thanks in advance,
From: Dave Cramer [mailto:pg(at)fastcrypt(dot)com]
Sent: Monday, June 06, 2005 4:23 PM
To: Carl Olivier
Subject: Re: [JDBC] DatabaseMetaData and Transactions
One of the queries is failing, have a look at the logs in postgres and
report back to us what is failing.
On 6-Jun-05, at 9:38 AM, Carl Olivier wrote:
> Having a problem with regards DatabaseMetaData retrievals within a
> Transaction. I have a large transaction running - within which
> database alterations need to occur. However, during this process I
> need to retrieve
> Table metadata (via the DatabaseMetaData.getTables() method).
> However, this
> does not seem possible in POSTGRES? I receive the following error:
> ERROR: current transaction is aborted, queries ignored until end of
> transaction block.
> I trace that directly to a call to the getTables method of the
> DatabaseMetaData implementation.
> Can anyone provide me with any advice here? Is this correct
> behaviour, and is there any way (other than caching table metadata
> prior to, and maintaining said cache during the transaction) to allow
> for meta data retrieval during a transaction?
> Thanks in advance!
> ---------------------------(end of
> TIP 6: Have you searched our list archives?
pgsql-jdbc by date
|Next:||From: Gilles Dubochet||Date: 2005-06-07 16:11:16|
|Subject: Binary precision of a number type|
|Previous:||From: Sylvain Boily||Date: 2005-06-07 09:34:27|
|Subject: Probleme with jdbc driver an openxhange.|