How to create a Connection Pool for PostgreSql on Glassfish 3.1.1

This tutorial assumes that

1.) You already have Glassfish 3.1.1 installed.
https://blogs.oracle.com/java/entry/glassfish_3_1_1

2.) Create and start a Glassfish domain
  a.) asadmin create-domain czetsuya
  b.) asadmin start-domain czetsuya

Steps
1.) Navigate to http://localhost:4848 (4848 is the default admin port for glassfish)
2.) In the left side click Resources->JDBC
3.) Click JDBC Connection Pools
  a.) Click New and enter myPool, ConnectionPoolDataSource, Postgresql on the input fields

  b.) Click next, in the Datasource Classname: PGConnectionPoolDataSource must be selected. Below you should fill up at least user, password, database.
  c.) Click finish.
4.) Create a JDBC Resource base on the connection pool created.
  a.) Under Resources->JDBC->JDBC Resources, select New and enter the ff values and don't forget to choose our newly created pool "myPool"
5.) We're done :-). Don't forget to create a postgres user admin/admin. And database with name czetsuya.
How to create a Connection Pool for PostgreSql on Glassfish 3.1.1 How to create a Connection Pool for PostgreSql on Glassfish 3.1.1 Reviewed by Edward Legaspi on Tuesday, May 01, 2012 Rating: 5

No comments:

Powered by Blogger.