dev@glassfish.java.net

Re: Urgent help: Connection Pool Properties

From: Lance J. Andersen <Lance.Andersen_at_Sun.COM>
Date: Tue, 17 Jun 2008 12:30:01 -0400

Here are the properties that I use with Glassfish:

postgresql.dbName=foobar
postgresql.server=localhost
postgresql.port=5432

postgresql.user=user1
postgresql.passwd=secret

postgresql.poolName=my-postgresql-pool
postgresql.dataSource=org.postgresql.ds.PGSimpleDataSource
postgresql.properties=user\=${postgresql.user}:password\=${postgresql.passwd}:DatabaseName\=${postgresql.dbName}\:ServerName\=${postgresql.server}\:port\=${postgresql.port}


The above gets set using ant invoking asadmin


Make sure that postgresql.jar is accessible via the appserver either in
the lib or domains/lib/ext directory and you have rebooted after adding
the driver jar.


URL is currently not a standard JDBC property and I have never used it
myself with Postgresql


Also look in the server.log for additiona info.
Lee Andrew wrote:
> Hi,
>
> I am setting up a connection pool that points to a PostgreSQL
> database. Both, the application server and the database are
> installed in the same server.
>
> I am receiving the error message "Class name is wrong or classpath is
> not set for : org.postgresql.ds.PGSimpleDataSource"
> when I press the "Ping" button in the General tab of the connection pool.
>
> *The general settings are:*
> Name: LocalPostgreTest
> DataSource Classname: org.postgresql.ds.PGSimpleDataSource
> Resource type: javax.sql.DataSource
>
> *The additional parameters are:*
> databaseName=test
> portNumber=5432
> driverClass=org.postgresql.Driver
> URL=jdbc:postgresql://localhost:5432/test
> serverName=localhost
> password=125015%hort
> user=alea
>
> The database is configured to accept local connections and I
> also have another application server in my desktop that is
> accessing the database normally using the fixed IP address
> instead of the localhost and is working fine.
>
> Can anybody help me fix this issue?
>
> Regards,
>
> --
> Lee Andrew | Development | Alea Management & Technology Solution