Skip to content

Commit

Permalink
Upgrading the MySQL Connector to v6.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihajlovski committed Mar 29, 2017
1 parent 2a23b09 commit 539ac89
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
7 changes: 4 additions & 3 deletions pom.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down Expand Up @@ -72,7 +73,7 @@
<validator.version>5.2.4.Final</validator.version>
<el.version>2.2.5</el.version>

<mysql-connector.version>5.1.38</mysql-connector.version>
<mysql-connector.version>6.0.6</mysql-connector.version>
<h2.version>1.4.187</h2.version>
<hsqldb.version>2.3.3</hsqldb.version>
<postgresql-version>9.4.1211</postgresql-version>
Expand Down Expand Up @@ -176,7 +177,7 @@
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
<check />
<check/>
<formats>
<format>html</format>
<format>xml</format>
Expand Down
@@ -1,5 +1,5 @@
jdbc:
driver: com.mysql.jdbc.Driver
driver: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://mysql:3306?logger=Slf4JLogger
username: root
password: root
Expand Down
@@ -1,13 +1,13 @@
jdbc:
driver: com.mysql.jdbc.Driver
driver: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/rapidoid
username: root
password: root

hibernate:
dialect: org.hibernate.dialect.MySQL5Dialect
connection:
driver_class: com.mysql.jdbc.Driver
driver_class: com.mysql.cj.jdbc.Driver
username: root
password: root
url: jdbc:mysql://localhost:3306/rapidoid
Expand Up @@ -78,7 +78,7 @@ public void configure() {

public static String inferDriverFromUrl(String url) {
if (url.startsWith("jdbc:mysql:")) {
return "com.mysql.jdbc.Driver";
return "com.mysql.cj.jdbc.Driver";
} else if (url.startsWith("jdbc:h2:")) {
return "org.hibernate.dialect.H2Dialect";
} else if (url.startsWith("jdbc:hsqldb:")) {
Expand Down
Expand Up @@ -20,13 +20,12 @@
* #L%
*/

import com.mysql.jdbc.exceptions.jdbc4.CommunicationsException;
import org.junit.Test;
import org.rapidoid.annotation.Authors;
import org.rapidoid.annotation.Since;
import org.rapidoid.jdbc.C3P0ConnectionPool;
import org.rapidoid.jdbc.JDBC;
import org.rapidoid.jdbc.JdbcClient;
import org.rapidoid.jdbc.C3P0ConnectionPool;
import org.rapidoid.u.U;
import org.rapidoid.util.Msc;

Expand All @@ -45,7 +44,7 @@ public void testWithMySQL() {
try {
JDBC.execute("create table abc (id int)");
} catch (Exception e) {
eq(e.getCause().getClass(), CommunicationsException.class);
eq(e.getCause().getClass().getSimpleName(), "CommunicationsException");
}

isFalse(JDBC.api().usePool());
Expand Down

0 comments on commit 539ac89

Please sign in to comment.