Setting up JDBC Connection Pool and JDBC Resources in Payara for PostgreSQL

 

In Post # 1 of Comparabien.com.pe we saw how to install PostgreSQL and Payara. Now we will see how to configure a JDBC Connection Pool and JDBC Resource in Payara.

Starting the Domain

First of all, we make sure that the domain is started and the administrative site can be used on port 4848.


If I go to http://localhost:4848 / I will be able to access the Payara Server administrative console:


Creating a JDBC Connection Pool

First, we go to JDBC Connection Pool and click on the button New:


We enter the name of the connection pool, the resource type, the database driver vendor and click on the button Next:


The page shows us all the possible settings and suggested properties:



On this screen at the end you will see properties that I recommend you delete to start from scratch, just click on those two buttons and that's it:



The final result should be the following:


Then you must add your properties so that you can connect without problems. Be careful, your postgres user must have a password, blank passwords are not accepted. After adding the properties, don't forget to click on the button Finish:



Finally, we click on the ping button to see if we can connect without problems:



IMPORTANT NOTE: I have created a connection pool to the postgres database. If later you need to connect to another DB you must perform the same procedure.


Creating a JDBC Resources

First, we click on the New button:


We configure the JDBC Resource data:



The jdbc/macpostgres in my case I can already use in my java projects:



Alternative via commands

All of the above could be done via commands, I leave them as additional information.



Enjoy!


Joe






Share:

0 comentarios:

Publicar un comentario