July 24, 2015 Suraj Chhetry
Installing Driver
- Download Postgres JDBC driver
- Copy the driver to GLASS_FISH_HOME/domains/YOUR_DOMAIN/lib , for example /opt/java_tools/payara41/glassfish/domains/domain1/lib/
- Restart Server
Creating Connection Pool
- Goto Resource >> JDBC >> JDBC Connection Pools
- Press New Button
- Give Pool Name say TEST_POOL
- Select Resource Type to javax.sql.ConnectionPoolDataSource
- Select Vendor as Postgres
- Press Next
- Goto Additional Properties
- Select all and remove
- Add properties as shown below
10. Press Finish
11. Select Pool
12. Click on Ping . If everything is correctly entered, it shows Ping Succeeded
Adding JDBC Resources
- Click " New "
- Give JNDI Name say "jdbc/TEST"
- Select Pool Name which is created earlier " TEST_POOL "
- Press OK
Now, JDBC datasource is created .
Happy Coding...