Prosit Java EE JPA Workshop CESI about Java persistence API
All instruction are in WS Etudiant.docx
docker run --name mysql -e MYSQL_ROOT_PASSWORD=admin -p 3306:3306 -d mysql
you will find in the bdd folder the sql script to create the database.
Ubuntu version 20+
Version required: 8
sudo apt update
sudo apt install openjdk-8-jdk
sudo apt install maven
Follow the link to download the version needed for the project https://search.maven.org/artifact/fish.payara.distributions/payara/5.191/zip
Unzip the file where you want, that's it, it's installed !
follow the link and download https://dev.mysql.com/downloads/file/?id=494900
Unzip the archive and put the mysql-connector-java.jar into :
./payara/glassfish/lib/
Edit ~/.profile to add at the bottom of the file this :
export M2_HOME="/usr/share/maven"
GLASSFISH_HOME="<your path>/payara5"
export PATH="$PATH:$GLASSFISH_HOME/bin"
change "your path" by where your payara folder is
First of all to execute command on payara you must go into ./payara/bin/ and execute asadmin script
asadmin start-domain
asadmin stop-domain
To access to the admin console go to localhost:4848
For this workshop you can use the default domain, domain1
To configure the pool connection to enable payara to connect to mysql bdd type this command :
asadmin add-resources ./appli/bookStore/src/main/setup/glassfish-resources.xml
If after that your unable to connect, you can check in the admin console