pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
JDBC driver does not support getGeneratedKeys method
2+ messages / 2 participants
[nested] [flat]

* JDBC driver does not support getGeneratedKeys method
@ 2006-04-25 22:53 Thomas SMETS <tsmets@brutele.be>
  2006-04-25 23:59 ` Re: JDBC driver does not support getGeneratedKeys method Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Thomas SMETS @ 2006-04-25 22:53 UTC (permalink / raw)
  To: pgsql-jdbc



Dear,

I try to use Log4J new DBAppender (cfr. the config file herebelow) but
it keeps on complaining with the following message :
	

Reported error: "Exception in Action for tag <appender>" at line 20
column -1
java.lang.IllegalStateException: DBAppender cannot function if the JDBC
driver does not support getGeneratedKeys method *and* without a specific
SQL dialect
	at org.apache.log4j.db.DBAppender.activateOptions(DBAppender.java:179)

As I cannot get the information out of the ML's of Log4J ( Log4J Users
List <log4j-user@logging.apache.org>, 
ML log4j dev <log4j-dev@logging.apache.org> ) on how to set the
SQL_DIALECT variable ....  I was wandering if the postgresql driver
allowed for getGeneratedKeys....

I was wandering if I needed to use the "jxDBCon-Open Source JDBC driver
framework" available here : http://jxdbcon.sourceforge.net/ ... ?

Tx,

\T,




-- 
Thomas Lionel SMETS
rue J. Wytsmanstraat 62
1050 Brussels
T : +32 (0)2 742 05 94
M : +32 (0)497 44 68 12
@ : duvelbier-tsmets@yahoo.com
Do you skype (callto://tsmets) ?



<snip>

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration
    debug="true"
    xmlns:log4j='http://jakarta.apache.org/log4j/';

  <appender name="DB" class="org.apache.log4j.db.DBAppender">
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d %-5p %c - %m%n"/>
    </layout>
    <connectionSource
class="org.apache.log4j.db.DriverManagerConnectionSource">
        <param name="driver" value="org.postgresql.Driver" />
        <param name="url"
value="jdbc:postgresql://localhost:5432/Log4j" />
        <param name="username" value="xyz" />
        <param name="password" value="xyz" />
        <param name="dialect" value="POSTGRES_DIALECT" />
    </connectionSource>
        
  </appender>

  <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d %-5p %c - %m%n"/>
    </layout>
  </appender>
  
  
  <root>
    <level value ="debug"/>
    <appender-ref ref="Db" />
  </root>
  <logger name="com">
    <level value="debug" />
    <appender-ref ref="STDOUT" />
  </logger>
</log4j:configuration>



</snip>





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: JDBC driver does not support getGeneratedKeys method
  2006-04-25 22:53 JDBC driver does not support getGeneratedKeys method Thomas SMETS <tsmets@brutele.be>
@ 2006-04-25 23:59 ` Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Kris Jurka @ 2006-04-25 23:59 UTC (permalink / raw)
  To: buvelbier-tsmets@yahoo.com; +Cc: pgsql-jdbc



On Wed, 26 Apr 2006, Thomas SMETS wrote:

> I try to use Log4J new DBAppender (cfr. the config file herebelow) but
> it keeps on complaining with the following message :
>

The problem with the log4j code is that it has a number of warning 
messages that probably ought to be more fatal.  You have some properties 
set incorrectly, so it cannot create a valid connection which results in 
this particular error.

>        <param name="driver" value="org.postgresql.Driver" />
>        <param name="url"
> value="jdbc:postgresql://localhost:5432/Log4j" />
>        <param name="username" value="xyz" />
>        <param name="password" value="xyz" />
>        <param name="dialect" value="POSTGRES_DIALECT" />

use param names driverClass and user instead of driver and username.  Also 
remove the dialect param.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-04-25 23:59 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-04-25 22:53 JDBC driver does not support getGeneratedKeys method Thomas SMETS <tsmets@brutele.be>
2006-04-25 23:59 ` Kris Jurka <books@ejurka.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox