Installing PostgreSQL and Payara Server

We are already July 11, 2021; and my plan is to show in the following posts a demo about the clone of https://comparabien.com.pe where the frontend has been built with Angular and the Backend has been built in two alternatives: Net Core and Jakarta EE + Microprofile running on Payara Server

Thanks to my colleague Jorge Pingo for being the author of the FrontEnd version in Angular and Backend in Java. The Net Core version is my own.

The demo can be built with the following requirements:

  1. Windows, Linux or Mac OSX. I'm going to use Mac Big Sur.
  2. You need to have Java 11 installed. You can use the Oracle JDK for free in development and testing, but if you need it for production it is better to use a free version like AdoptOpenJDK or similars.
  3. IDE for Java. I will use IntelliJ IDEA.  You can use Visual Studio Code as an alternative.
  4. IDE for Angular. I will use WebStorm. You can use Visual Studio Code as an alternative.
  5. IDE for NetCore. I will use Rider. You can use Visual Studio Code as an alternative or Visual Studio Community.
  6. To work with a database (DB) I suggest that you install the one that you will always use on your machine, but, if it is only for demo or temporary, a simple option is to install Docker for Desktop to install the DB you want only for a short time.
  7. To consult the different databases that we need, I use a single client: Jetbrains DataGrip


Installing PostgreSQL

I'm going to skip the installation requirements and download the installer and run it in my local pc for our demo.

You can download PostgreSQL from this link. There is a version for Windows, Linux and Mac OSX. The installer also gives you the option to install the PgAdmin which is a client for this database.

But, for Mac I recommend: https://postgresapp.com/ is super simple, you install it, create a server and your username is the same that exists in your machine, but without password (josediaz in my case).


It creates the databases: postgres, template1 and one with the name of your username.



Postgresapp permits you to indicate if you want that the database will be available when you do log in on your pc or open databases with iTerm. 


In the upper bar you can control the service according to your needs.


Connecting with DataGrip

DataGrip has support for different databases, and will allow us to connect to SQL Server and PostgreSQL.


I will connect to my PostgreSQL like this:


We do a connection test and we will be ready:


Installing Payara Server

I recommend using Payara Server for Jakarta EE and Microprofile projects, the community version is more than enough for our demo. But, if you need support, these guys have great plans for medium and large companies. In Peru, your friends from JoeDayz.pe can support you.

I have downloaded the full version:





I recommend a Tools folder for your tools. There I will download and use it in the following steps.



Now we are going to add it to the PATH. In Windows it is in system environment variables, in Linux in .bash_profile. In Mac Big Sur I will use my .zhrc file:


Next, we execute the following command to validate that everything works correctly:


asadmin start-domain

Add PostgreSQL Driver to Payara

First we need the driver, which you can easily get from https://mvnrepository.com/artifact/org.postgresql/postgresql/42.2.23 and download it to your machine.






Once installed, we can configure it with Payara when we want to create a pool of connections. We will do that in the next post and you can follow the demos without problems.

Enjoy!

Joe





Share:

0 comentarios:

Publicar un comentario