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

Mysql driver is basically updated #96

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ dependency-reduced-pom.xml
nb-configuration.xml
nbactions*.xml
.checkstyle
.vscode

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
5 changes: 2 additions & 3 deletions openjpa-examples/openbooks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -241,4 +241,3 @@

</profiles>
</project>

2 changes: 1 addition & 1 deletion openjpa-examples/openbooks/run.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ openjpa.version=2.3.0-SNAPSHOT
openjpa.lib=${maven.repos}/org/apache/openjpa/openjpa-all/${openjpa.version}
# Other depends
# MySQL
#jdbc.driver=${maven.repos}/mysql/mysql-connector-java/5.1.12/mysql-connector-java-5.1.12.jar
#jdbc.driver=${maven.repos}/com.mysql/mysql-connector-j/8.0.31/mysql-connector-j-8.0.31.jar
# Derby
jdbc.driver=${maven.repos}/org/apache/derby/derby/10.8.2.2/derby-10.8.2.2.jar
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 @@ -147,7 +147,7 @@ public MySQLDictionary() {
"INTEGER", "INTERVAL", "INTO", "IS", "ITERATE", "JOIN", "KEY", "KEYS", "KILL", "LEADING", "LEAVE", "LEFT", "LIKE",
"LIMIT", "LINES", "LOAD", "LOCALTIME", "LOCALTIMESTAMP", "LOCK", "LONG", "LONGBLOB", "LONGTEXT", "LOOP", "LOW_PRIORITY",
"MATCH", "MAXVALUE", "MEDIUMBLOB", "MEDIUMINT", "MEDIUMTEXT", "MIDDLEINT", "MINUTE_MICROSECOND", "MINUTE_SECOND",
"MOD", "MODIFIES", "NATURAL", "NO_WRITE_TO_BINLOG", "NOT", "NULL", "NUMERIC", "ON", "OPTIMIZE", "OPTION", "OPTIONALLY",
"MOD", "MODIFIES", "NATURAL", "NO_WRITE_TO_BINLOG", "NOT", "NTILE", "NULL", "NUMERIC", "ON", "OPTIMIZE", "OPTION", "OPTIONALLY",
"OR", "ORDER", "OUT", "OUTER", "OUTFILE", "PARTITION", "PRECISION", "PRIMARY", "PROCEDURE", "PURGE", "RANGE", "READ",
"READS", "REAL", "REFERENCES", "REGEXP", "RELEASE", "RENAME", "REPEAT", "REPLACE", "REQUIRE", "RESIGNAL", "RESTRICT",
"RETURN", "REVOKE", "RIGHT", "RLIKE", "SCHEMA", "SCHEMAS", "SECOND_MICROSECOND", "SENSITIVE", "SEPARATOR", "SET",
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.openjpa.jdbc.sql.DBDictionary;
import org.apache.openjpa.jdbc.sql.H2Dictionary;
import org.apache.openjpa.jdbc.sql.HSQLDictionary;
import org.apache.openjpa.jdbc.sql.MySQLDictionary;
import org.apache.openjpa.jdbc.sql.PostgresDictionary;
import org.apache.openjpa.jdbc.sql.SQLServerDictionary;
import org.apache.openjpa.jdbc.sql.SybaseDictionary;
Expand Down Expand Up @@ -98,7 +99,7 @@ public void testJDBCEscape() {
"select a from Employee a where a.hireTimestamp >= {ts '2009-08-25 00:00:00.123456'}",
"select {t '00:00:00'}, a.empId from Employee a",
};
} else if (dict instanceof PostgresDictionary || dict instanceof H2Dictionary) {
} else if (dict instanceof PostgresDictionary || dict instanceof H2Dictionary || dict instanceof MySQLDictionary) {
jpql = new String[] {
"select a from Employee a where a.hireDate >= {d '2009-08-25'}",
"select a from Employee a where a.hireDate >= {d '2009-8-5'}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ NOTHING
NOTIFY
NOTNULL
NOWAIT
NTILE
NULL
NULLABLE
NULLIF
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
6 changes: 3 additions & 3 deletions openjpa-slice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@
</activation>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>${mysql.connector.version}</version>
<scope>test</scope>
</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 Expand Up @@ -79,9 +79,9 @@ Specifying connection settings in the plugin section
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.11</version>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.0.31</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Loading