Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-3062 have support for both MySQL 5 and 8 datasources #3358

Merged
merged 1 commit into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# only if the new code is made subject to such option by the copyright
# holder.
#
# Portions Copyright [2017] [Payara Foundation and/or its affiliates]
# Portions Copyright [2017-2018] [Payara Foundation and/or its affiliates]

ORACLE=oracle.jdbc.pool.OracleConnectionPoolDataSource
DERBY=org.apache.derby.jdbc.ClientConnectionPoolDataSource40
Expand All @@ -52,7 +52,8 @@ MICROSOFTSQLSERVER=com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSourc
SYBASE=com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource
POINTBASE=com.pointbase.jdbc.jdbcDataSource
INFORMIX=com.informix.jdbcx.IfxConnectionPoolDataSource
MYSQL=com.mysql.cj.jdbc.MysqlConnectionPoolDataSource
MYSQL=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
MYSQL8=com.mysql.cj.jdbc.MysqlConnectionPoolDataSource
POSTGRESQL=org.postgresql.ds.PGConnectionPoolDataSource
DATADIRECT-DB2=com.ddtek.jdbcx.db2.DB2DataSource
DATADIRECT-ORACLE=com.ddtek.jdbcx.oracle.OracleDataSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# only if the new code is made subject to such option by the copyright
# holder.
#
# Portions Copyright [2017] [Payara Foundation and/or its affiliates]
# Portions Copyright [2017-2018] [Payara Foundation and/or its affiliates]

#Values are added to complete properties file structure.
Oracle=ORACLE
Expand All @@ -55,6 +55,7 @@ Pointbase=POINTBASE
Cloudscape=CLOUDSCAPE
Informix=INFORMIX
MySql=MYSQL
MySql8=MYSQL8
Postgresql=POSTGRESQL
DataDirect-DB2=DATADIRECT-DB2
DataDirect-Oracle=DATADIRECT-ORACLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# only if the new code is made subject to such option by the copyright
# holder.
#
# Portions Copyright [2017] [Payara Foundation and/or its affiliates]
# Portions Copyright [2017-2018] [Payara Foundation and/or its affiliates]

ORACLE=oracle.jdbc.pool.OracleDataSource
DERBY=org.apache.derby.jdbc.ClientDataSource40
Expand All @@ -53,7 +53,8 @@ SYBASE=com.sybase.jdbc2.jdbc.SybDataSource
POINTBASE=com.pointbase.jdbc.jdbcDataSource
CLOUDSCAPE=com.cloudscape.core.BasicDataSource
INFORMIX=com.informix.jdbcx.IfxDataSource
MYSQL=com.mysql.cj.jdbc.MysqlDataSource
MYSQL=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
MYSQL8=com.mysql.cj.jdbc.MysqlDataSource
POSTGRESQL=org.postgresql.ds.PGSimpleDataSource
DATADIRECT-DB2=com.ddtek.jdbcx.db2.DB2DataSource
DATADIRECT-ORACLE=com.ddtek.jdbcx.oracle.OracleDataSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# only if the new code is made subject to such option by the copyright
# holder.
#
# Portions Copyright [2017] [Payara Foundation and/or its affiliates]
# Portions Copyright [2017-2018] [Payara Foundation and/or its affiliates]

ORACLE=org.glassfish.api.jdbc.validation.OracleConnectionValidation
DATADIRECT-ORACLE=org.glassfish.api.jdbc.validation.OracleConnectionValidation
Expand All @@ -53,6 +53,7 @@ DATADIRECT-DB2=org.glassfish.api.jdbc.validation.DB2ConnectionValidation
MICROSOFTSQLSERVER=org.glassfish.api.jdbc.validation.MSSQLConnectionValidation
DATADIRECT-MICROSOFT-SQL-SERVER=org.glassfish.api.jdbc.validation.MSSQLConnectionValidation
MYSQL=org.glassfish.api.jdbc.validation.MySQLConnectionValidation
MYSQL8=org.glassfish.api.jdbc.validation.MySQLConnectionValidation
DATADIRECT-MYSQL=org.glassfish.api.jdbc.validation.MySQLConnectionValidation
POSTGRESQL=org.glassfish.api.jdbc.validation.PostgresConnectionValidation
SYBASE=org.glassfish.api.jdbc.validation.SybaseConnectionValidation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# only if the new code is made subject to such option by the copyright
# holder.
#
# Portions Copyright [2017] [Payara Foundation and/or its affiliates]
# Portions Copyright [2017-2018] [Payara Foundation and/or its affiliates]

ORACLE=oracle.jdbc.xa.client.OracleXADataSource
DERBY=org.apache.derby.jdbc.ClientXADataSource40
Expand All @@ -53,7 +53,8 @@ SYBASE=com.sybase.jdbc2.jdbc.SybXADataSource
POINTBASE=com.pointbase.xa.xaDataSource
CLOUDSCAPE=com.cloudscape.core.XADataSource
INFORMIX=com.informix.jdbcx.IfxXADataSource
MYSQL=com.mysql.cj.jdbc.MysqlXADataSource
MYSQL=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
MYSQL8=com.mysql.cj.jdbc.MysqlXADataSource
POSTGRESQL=org.postgresql.xa.PGXADataSource
DATADIRECT-DB2=com.ddtek.jdbcx.db2.DB2DataSource
DATADIRECT-ORACLE=com.ddtek.jdbcx.oracle.OracleDataSource
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.

The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common Development
and Distribution License("CDDL") (collectively, the "License"). You
may not use this file except in compliance with the License. You can
obtain a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
or packager/legal/LICENSE.txt. See the License for the specific
language governing permissions and limitations under the License.

When distributing the software, include this License Header Notice in each
file and include the License file at packager/legal/LICENSE.txt.

GPL Classpath Exception:
Oracle designates this particular file as subject to the "Classpath"
exception as provided by Oracle in the GPL Version 2 section of the License
file that accompanied this code.

Modifications:
If applicable, add the following below the License Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyright [year] [name of copyright owner]"

Contributor(s):
If you wish your version of this file to be governed by only the CDDL or
only the GPL Version 2, indicate your decision by adding "[Contributor]
elects to include this software in this distribution under the [CDDL or GPL
Version 2] license." If you don't indicate a single choice of license, a
recipient has the option to distribute your version of this file under
either the CDDL, the GPL Version 2 or to extend the choice of license to
its licensees as provided above. However, if you add GPL Version 2 code
and therefore, elected the GPL Version 2 license, then the option applies
only if the new code is made subject to such option by the copyright
holder.

-->
<!-- Portions Copyright [2018] Payara Foundation and/or afffiliates -->

<!DOCTYPE resources PUBLIC "-//Payara.fish//DTD Payara Server 4 Resource Definitions//EN" "http://docs.payara.fish/schemas/payara-resources_1_6.dtd*">

<!--
MySQL8 Type 4.2 Driver
The JAR file for the MySQL driver is mysql-connector-java-version.jar,
for example, mysql-connector-java-8.0.12.jar.

To learn more on JDBC resources, pl. refer to JDBC resources chapter of admin guide.
Administration Guide >> JDBC Resources >> Configurations for Specific JDBC Drivers
http://docs.sun.com/app/docs/doc/819-3658/6n5s5nklk?a=view

For detailed explanation of attributes and elements of this resources xml
pl. refer to payara-resources_1_6.dtd

======================================================================================================
| res-type datasource-classname |
======================================================================================================
| javax.sql.DataSource com.mysql.cj.jdbc.MysqlDataSource |
| javax.sql.ConnectionPoolDataSource com.mysql.cj.jdbc.MysqlConnectionPoolDataSource |
| javax.sql.XADataSource com.mysql.cj.jdbc.MysqlXADataSource |
======================================================================================================
-->

<resources>
<jdbc-connection-pool
name="mysql-pool"
datasource-classname="com.mysql.cj.jdbc.MysqlDataSource"
res-type="javax.sql.DataSource">
<property name="user" value="DB_USER"/>
<property name="password" value="DB_PASSWORD"/>
<property name="url" value="jdbc:mysql://DB_HOSTNAME:3306/DATABASE_NAME"/>
</jdbc-connection-pool>

<jdbc-resource
enabled="true"
jndi-name="jdbc/mysql-resource"
object-type="user"
pool-name="mysql-pool"/>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@
======================================================================================================
| res-type datasource-classname |
======================================================================================================
| javax.sql.DataSource com.mysql.cj.jdbc.MysqlDataSource |
| javax.sql.ConnectionPoolDataSource com.mysql.cj.jdbc.MysqlConnectionPoolDataSource |
| javax.sql.XADataSource com.mysql.cj.jdbc.MysqlXADataSource |
| javax.sql.DataSource com.mysql.jdbc.jdbc2.optional.MysqlDataSource |
| javax.sql.ConnectionPoolDataSource com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource |
| javax.sql.XADataSource com.mysql.jdbc.jdbc2.optional.MysqlXADataSource |
======================================================================================================
-->

<resources>
<jdbc-connection-pool
name="mysql-pool"
datasource-classname="com.mysql.cj.jdbc.MysqlDataSource"
datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
res-type="javax.sql.DataSource">
<property name="user" value="DB_USER"/>
<property name="password" value="DB_PASSWORD"/>
Expand Down