Re: Error while retrieving generated keys - Mailing list pgsql-jdbc

From QuanZongliang
Subject Re: Error while retrieving generated keys
Date
Msg-id BAY106-W2067CB520F9E75A8FB33AAB5780@phx.gbl
Whole thread Raw
In response to Error while retrieving generated keys  ("Gary Greenberg" <gary@icontrol.com>)
Responses Re: Error while retrieving generated keys  ("Gary Greenberg" <gary@icontrol.com>)
List pgsql-jdbc
from AbstractJdbc3Connection.java:
 
348    public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
349    throws SQLException
350    {
351        if (autoGeneratedKeys != Statement.NO_GENERATED_KEYS)
352            throw new PSQLException(GT.tr("Returning autogenerated keys is not supported."), PSQLState.NOT_IMPLEMENTED);
353        return prepareStatement(sql);
354    }

So, it is not supported.

Only the prepareStatement(sql, Statement.NO_GENERATED_KEYS) can be used.

From: gary@icontrol.com
To: pgsql-jdbc@postgresql.org
Subject: [JDBC] Error while retrieving generated keys
Date: Thu, 8 Mar 2007 19:49:52 -0800

My application trew the following exception:

 

org.postgresql.util.PSQLException: Returning autogenerated keys is not supported.

        at org.postgresql.jdbc3.AbstractJdbc3Connection.prepareStatement(AbstractJdbc3Connection.java:352)

        at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:394)

        at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:370)

 

I am using 8.2-504.jdbc3 driver with the PostgreSql 8.0.8 on SUSE Linux.

I have not seen anywhere in the documentation that this standard JDBC3 feature is not supported.

Can anyone explain it to me, please.

pgsql-jdbc by date:

Previous
From: "Gary Greenberg"
Date:
Subject: Error while retrieving generated keys
Next
From: Giuseppe Sacco
Date:
Subject: [OT] Re: Transaction atomicity