Search This Blog

Thursday, November 22, 2018

Include JDBC driver in your application for Payara Micro Java Application Server

Add dependencies to your app:

<dependencies>
<dependency>
<groupId>fish.payara.extras</groupId>
<artifactId>payara-micro</artifactId>
<version>4.1.1.171.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.37</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.common</groupId>
<artifactId>glassfish-api</artifactId>
<version>4.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

The following is un-verified:
Unless you use a derby database, the driver for your database will not be available out of the box on Payara Micro, in this case, you need to copy the driver to the WEB-INF/lib folder of your application.