Skip to content

Commit

Permalink
Mysql driver is basically updated
Browse files Browse the repository at this point in the history
  • Loading branch information
solomax committed Jun 21, 2022
1 parent c3da147 commit 91973c2
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<class>demo.Actor</class>

<properties>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/jest"/>
<property name="javax.persistence.jdbc.user" value="root"/>
<property name="javax.persistence.jdbc.password" value=""/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<properties>
<!-- Use these for MySQL
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/OpenBooks"/>
<property name="javax.persistence.jdbc.user" value="user"/>
<property name="javax.persistence.jdbc.password" value="password"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<properties>
<property name="openjpa.BrokerFactory" value="slice"/>
<property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
<property name="openjpa.ConnectionDriverName" value="com.mysql.cj.jdbc.Driver"/>
<property name="openjpa.ConnectionUserName" value="demo"/>
<property name="openjpa.ConnectionPassword" value="pwd"/>

Expand Down Expand Up @@ -68,7 +68,7 @@
<class>org.apache.openjpa.trader.domain.Trade</class>
<class>org.apache.openjpa.trader.domain.Stock</class>
<properties>
<property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
<property name="openjpa.ConnectionDriverName" value="com.mysql.cj.jdbc.Driver"/>
<property name="openjpa.ConnectionURL" value="jdbc:mysql://localhost/exchange"/>
<property name="openjpa.ConnectionUserName" value="root"/>
<property name="openjpa.ConnectionPassword" value=""/>
Expand All @@ -90,7 +90,7 @@
<class>org.apache.openjpa.trader.domain.Trade</class>
<class>org.apache.openjpa.trader.domain.Stock</class>
<properties>
<property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
<property name="openjpa.ConnectionDriverName" value="com.mysql.cj.jdbc.Driver"/>
<property name="openjpa.ConnectionURL" value="jdbc:mysql://opentrader.cxlsv2qt7orp.us-east-1.rds.amazonaws.com:3306/exchange"/>
<property name="openjpa.ConnectionUserName" value="ppoddar"/>
<property name="openjpa.ConnectionPassword" value="password"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ ConnectionDriverName-values: org.hsqldb.jdbcDriver,org.hsql.jdbcDriver,\
org.h2.Driver,\
COM.cloudscape.core.JDBCDriver,in.co.daffodil.db.jdbc.DaffodilDBDriver,\
com.ddtek.jdbc.db2.DB2Driver,interbase.interclient.Driver,\
com.mysql.jdbc.Driver,com.ddtek.jdbc.oracle.OracleDriver,\
com.mysql.cj.jdbc.Driver,com.ddtek.jdbc.oracle.OracleDriver,\
org.postgresql.Driver,com.pointbase.jdbc.jdbcUniversalDriver,\
org.sourceforge.jxdbcon.JXDBConDriver,\
com.ddtek.jdbc.sqlserver.SQLServerDriver,com.jnetdirect.jsql.JSQLDriver,\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
import org.apache.openjpa.persistence.test.SingleEMFTestCase;

// -ea -Dopenjpa.ConnectionDriverName=com.mysql.jdbc.Driver -Dopenjpa.ConnectionPassword=openjpatst
// -ea -Dopenjpa.ConnectionDriverName=com.mysql.cj.jdbc.Driver -Dopenjpa.ConnectionPassword=openjpatst
// -Dopenjpa.ConnectionURL=jdbc:mysql://localhost:3306/openjpatst -Dopenjpa.ConnectionUserName=openjpatst
public class TestExplicitAccess extends SingleEMFTestCase {

Expand Down
2 changes: 1 addition & 1 deletion openjpa-project/BUILDING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ To run the tests in the debugger simply add the following JVM properties
-ea -Dopenjpa.ConnectionURL=jdbc:derby:target/database/openjpa-derby-database;create=true -Dopenjpa.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriver

For running against a MySQL Docker installation:
-ea -Dopenjpa.ConnectionDriverName=com.mysql.jdbc.Driver -Dopenjpa.ConnectionURL=jdbc:mysql://localhost:3306/openjpatst -Dopenjpa.ConnectionUserName=openjpatst -Dopenjpa.ConnectionPassword=openjpatst
-ea -Dopenjpa.ConnectionDriverName=com.mysql.cj.jdbc.Driver -Dopenjpa.ConnectionURL=jdbc:mysql://localhost:3306/openjpatst -Dopenjpa.ConnectionUserName=openjpatst -Dopenjpa.ConnectionPassword=openjpatst

Running against a PostgreSQL Docker installation:
-ea -Dopenjpa.ConnectionDriverName=org.postgresql.Driver -Dopenjpa.ConnectionURL=jdbc:postgresql://localhost:5432/openjpatst -Dopenjpa.ConnectionUserName=postgres -Dopenjpa.ConnectionPassword=postgres
Expand Down
6 changes: 3 additions & 3 deletions openjpa-project/src/doc/manual/ref_guide_slice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
For example, the following configuration will use two different JDBC
drivers for slice <classname>One</classname> and <classname>Two</classname>.
<programlisting>
<![CDATA[<property name="openjpa.slice.One.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
<![CDATA[<property name="openjpa.slice.One.ConnectionDriverName" value="com.mysql.cj.jdbc.Driver"/>
<property name="openjpa.slice.Two.ConnectionDriverName" value="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"/>]]>
</programlisting>
</para>
Expand All @@ -378,13 +378,13 @@
<property name="openjpa.slice.Two.ConnectionURL" value="jdbc:mysql:localhost//slice2"/>
<property name="openjpa.slice.Three.ConnectionURL" value="jdbc:oracle:localhost//slice3"/>
<property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
<property name="openjpa.ConnectionDriverName" value="com.mysql.cj.jdbc.Driver"/>
<property name="openjpa.slice.Three.ConnectionDriverName" value="oracle.jdbc.Driver"/>]]>
</programlisting>
In this example, <classname>Three</classname> will use slice-specific
<classname>oracle.jdbc.Driver</classname> driver while slice
<classname>One</classname> and <classname>Two</classname> will use
the driver <classname>com.mysql.jdbc.Driver</classname> as
the driver <classname>com.mysql.cj.jdbc.Driver</classname> as
specified by <classname>openjpa.ConnectionDriverName</classname>
property value.
</para>
Expand Down
6 changes: 3 additions & 3 deletions openjpa-project/src/doc/manual/supported_databases.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ users, but may not support every feature of this release, please refer to the
<link linkend="dbsupport_mysql">MySQL</link>
</entry>
<entry colname="dbversion">
5.0.26, 5.1.6, 5.7
5.0.26, 5.1.6, 5.7, 8.0.x
</entry>
<entry colname="drivname">
MySQL Driver
</entry>
<entry colname="drivversion">
5.1.6, 5.1.47
5.1.6, 5.1.47, 8.0.29
</entry>
</row>
<row>
Expand Down Expand Up @@ -1135,7 +1135,7 @@ Using the Sun JDBC-ODBC bridge to connect is not supported.
Example properties for MySQL
</title>
<programlisting>
openjpa.ConnectionDriverName: com.mysql.jdbc.Driver
openjpa.ConnectionDriverName: com.mysql.cj.jdbc.Driver
openjpa.ConnectionURL: jdbc:mysql://SERVER_NAME/DB_NAME
</programlisting>
</example>
Expand Down
2 changes: 1 addition & 1 deletion openjpa-slice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
</dependency>
</dependencies>
<properties>
<connection.driver.name>com.mysql.jdbc.Driver</connection.driver.name>
<connection.driver.name>com.mysql.cj.jdbc.Driver</connection.driver.name>
<connection.url>${openjpa.mysql.url}</connection.url>
<connection.username>${openjpa.mysql.username}</connection.username>
<connection.password>${openjpa.mysql.password}</connection.password>
Expand Down
18 changes: 9 additions & 9 deletions openjpa-slice/src/test/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,16 @@
<persistence-unit name="mysql">
<properties>
<property name="openjpa.BrokerFactory" value="slice"/>
<property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
<property name="openjpa.ConnectionDriverName" value="com.mysql.cj.jdbc.Driver"/>

<property name="openjpa.slice.Names" value="One,Two"/>
<property name="openjpa.slice.DistributionPolicy" value="org.apache.openjpa.slice.policy.UserDistributionPolicy"/>

<property name="openjpa.ConnectionUserName" value="root"/>
<property name="openjpa.ConnectionPassword" value=""/>
<property name="openjpa.slice.One.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
<property name="openjpa.slice.One.ConnectionDriverName" value="com.mysql.cj.jdbc.Driver"/>
<property name="openjpa.slice.One.ConnectionURL" value="jdbc:mysql://localhost/slice1"/>
<property name="openjpa.slice.Two.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
<property name="openjpa.slice.Two.ConnectionDriverName" value="com.mysql.cj.jdbc.Driver"/>
<property name="openjpa.slice.Two.ConnectionURL" value="jdbc:mysql://localhost/slice2"/>

<property name="openjpa.Multithreaded" value="false"/>
Expand Down Expand Up @@ -236,7 +236,7 @@
<persistence-unit name="car.mysql">
<properties>
<property name="openjpa.BrokerFactory" value="slice"/>
<property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
<property name="openjpa.ConnectionDriverName" value="com.mysql.cj.jdbc.Driver"/>

<property name="openjpa.slice.Names" value="BMW,Honda,Ford"/>

Expand Down Expand Up @@ -288,10 +288,10 @@

<property name="openjpa.ConnectionUserName" value="root"/>
<property name="openjpa.ConnectionPassword" value=""/>
<property name="openjpa.slice.S1.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S1,MaxTotal=4"/>
<property name="openjpa.slice.S2.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S2,MaxTotal=4"/>
<property name="openjpa.slice.S3.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S3,MaxTotal=4"/>
<property name="openjpa.slice.S4.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S4,MaxTotal=4"/>
<property name="openjpa.slice.S1.ConnectionProperties" value="DriverClassName=com.mysql.cj.jdbc.Driver,Url=jdbc:mysql://localhost/S1,MaxTotal=4"/>
<property name="openjpa.slice.S2.ConnectionProperties" value="DriverClassName=com.mysql.cj.jdbc.Driver,Url=jdbc:mysql://localhost/S2,MaxTotal=4"/>
<property name="openjpa.slice.S3.ConnectionProperties" value="DriverClassName=com.mysql.cj.jdbc.Driver,Url=jdbc:mysql://localhost/S3,MaxTotal=4"/>
<property name="openjpa.slice.S4.ConnectionProperties" value="DriverClassName=com.mysql.cj.jdbc.Driver,Url=jdbc:mysql://localhost/S4,MaxTotal=4"/>

<property name="openjpa.jdbc.DBDictionary" value="mysql"/>
<property name="openjpa.Multithreaded" value="false"/>
Expand All @@ -311,7 +311,7 @@

<property name="openjpa.ConnectionUserName" value="root"/>
<property name="openjpa.ConnectionPassword" value=""/>
<property name="openjpa.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S,MaxTotal=4"/>
<property name="openjpa.ConnectionProperties" value="DriverClassName=com.mysql.cj.jdbc.Driver,Url=jdbc:mysql://localhost/S,MaxTotal=4"/>

<property name="openjpa.jdbc.DBDictionary" value="mysql"/>
<property name="openjpa.Multithreaded" value="false"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public abstract class AbstractOpenJpaMojo extends AbstractMojo
* Sample:
* <pre>
* &lt;connectionProperties&gt;
* driverClass=com.mysql.jdbc.Driver,
* driverClass=com.mysql.cj.jdbc.Driver,
* jdbcUrl=jdbc:mysql://localhost/mydatabase,
* user=root,
* password=,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Specifying connection settings in the plugin section
<sqlFile>${project.build.directory}/database.sql</sqlFile>
<connectionDriverName>com.mchange.v2.c3p0.ComboPooledDataSource</connectionDriverName>
<connectionProperties>
driverClass=com.mysql.jdbc.Driver,
driverClass=com.mysql.cj.jdbc.Driver,
jdbcUrl=jdbc:mysql://localhost/TissExamples,
user=root,
password=,
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<!-- common JDBC driver versions -->
<derby.version>10.14.2.0</derby.version>
<hsqldb.version>2.5.1</hsqldb.version>
<mysql.connector.version>5.1.47</mysql.connector.version>
<mysql.connector.version>8.0.29</mysql.connector.version>
<mariadb.connector.version>2.7.2</mariadb.connector.version>
<postgresql.connector.version>42.2.19</postgresql.connector.version>
<mssql.connector.version>9.2.1.jre8</mssql.connector.version>
Expand Down Expand Up @@ -607,7 +607,7 @@
</dependency>
</dependencies>
<properties>
<connection.driver.name>com.mysql.jdbc.Driver</connection.driver.name>
<connection.driver.name>com.mysql.cj.jdbc.Driver</connection.driver.name>
<!--<connection.url>jdbc:mysql://localhost/OPENJPA</connection.url>-->
<connection.url>${openjpa.mysql.url}</connection.url>
<connection.username>${openjpa.mysql.username}</connection.username>
Expand Down Expand Up @@ -636,7 +636,7 @@
</dependency>
</dependencies>
<properties>
<connection.driver.name>com.mysql.jdbc.Driver</connection.driver.name>
<connection.driver.name>com.mysql.cj.jdbc.Driver</connection.driver.name>

<!-- default settings for local docker -->
<docker.external.mysql.port>3306</docker.external.mysql.port>
Expand Down

0 comments on commit 91973c2

Please sign in to comment.