Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
example resource.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
<jdbc-connection-pool name="jdbc/cloudsql-pool"
datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
idle-timeout-in-seconds="150"
is-connection-validation-required="true"
connection-validation-method="auto-commit"
res-type="javax.sql.DataSource" >
<property name="UseSSL" value="true"></property>
<property name="TrustCertificateKeyStoreType" value="JKS"></property>
<property name="Password" value="${ENV=CLOUD_SQL_PASSWORD}"></property>
<property name="RequireSSL" value="true"></property>
<property name="URL" value="${ENV=CLOUD_SQL_JDBC_URL}"></property>
<property name="VerifyServerCertificate" value="true"></property>
<property name="ServerName" value="${ENV=CLOUD_SQL_SERVER_NAME}"></property>
<property name="User" value="${ENV=CLOUD_SQL_USERNAME}"></property>
<property name="trustCertificateKeyStoreUrl" value="file://${com.sun.aas.instanceRoot}/config/cacerts.jks"></property>
<property name="trustCertificateKeyStorePassword" value="${ENV=PAYARA_ADMIN_PASSWORD}"></property>
<property name="clientCertificateKeyStoreUrl" value="file://${com.sun.aas.instanceRoot}/config/my-keystore.jks"></property>
<property name="clientCertificateKeyStorePassword" value="${ENV=CLOUD_SSL_STORE_PASSWORD}"></property>
</jdbc-connection-pool>
<jdbc-resource jndi-name="jdbc/cloudsql" pool-name="jdbc/cloudsql-pool" />
</resources>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.