Skip to content

Commit f37e257

Browse files
author
Cyrille Le Clerc
committed
JENKINS-54434 Bump MySql driver to 8.0.13
Remove JDBC URL properties validation as the list of supported properties is no longer available because com.mysql.jdbc.ConnectionPropertiesImpl has been removed in v8.x
1 parent 01d0f5b commit f37e257

File tree

6 files changed

+11
-75
lines changed

6 files changed

+11
-75
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
.idea
22
*.iml
3+
4+
target/
5+
work/
6+
*.log

pom.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
<parent>
44
<groupId>org.jenkins-ci.plugins</groupId>
55
<artifactId>plugin</artifactId>
6-
<version>2.26</version>
6+
<version>3.9</version>
7+
<relativePath />
78
</parent>
89

910
<groupId>org.jenkins-ci.plugins</groupId>
1011
<artifactId>database-mysql</artifactId>
1112
<version>1.3-SNAPSHOT</version>
1213
<packaging>hpi</packaging>
14+
<name>MySQL Database Plugin</name>
1315

1416
<url>https://wiki.jenkins-ci.org/display/JENKINS/MySQL+Database+Plugin</url>
1517

@@ -21,7 +23,7 @@
2123
<dependency>
2224
<groupId>mysql</groupId>
2325
<artifactId>mysql-connector-java</artifactId>
24-
<version>5.1.42</version>
26+
<version>8.0.13</version>
2527
</dependency>
2628
<dependency>
2729
<groupId>${project.groupId}</groupId>
Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
11
package org.jenkinsci.plugins.database.mysql;
22

3-
import com.mysql.jdbc.Driver;
4-
import groovy.lang.GroovyShell;
53
import hudson.Extension;
6-
import hudson.Util;
7-
import hudson.util.FormValidation;
84
import hudson.util.Secret;
95
import org.jenkinsci.plugins.database.AbstractRemoteDatabase;
106
import org.jenkinsci.plugins.database.AbstractRemoteDatabaseDescriptor;
117
import org.kohsuke.stapler.DataBoundConstructor;
12-
import org.kohsuke.stapler.QueryParameter;
13-
14-
import java.io.IOException;
15-
import java.io.InputStreamReader;
16-
import java.nio.charset.Charset;
17-
import java.util.Map;
18-
import java.util.Properties;
19-
import java.util.Set;
208

219
/**
2210
* @author Kohsuke Kawaguchi
@@ -28,8 +16,8 @@ public MySQLDatabase(String hostname, String database, String username, Secret p
2816
}
2917

3018
@Override
31-
protected Class<Driver> getDriverClass() {
32-
return Driver.class;
19+
protected Class<com.mysql.cj.jdbc.Driver> getDriverClass() {
20+
return com.mysql.cj.jdbc.Driver.class;
3321
}
3422

3523
@Override
@@ -40,31 +28,10 @@ protected String getJdbcUrl() {
4028
@Extension
4129
public static class DescriptorImpl extends AbstractRemoteDatabaseDescriptor {
4230

43-
private volatile Set<String> validPropertyNames;
44-
4531
@Override
4632
public String getDisplayName() {
4733
return "MySQL";
4834
}
4935

50-
public FormValidation doCheckProperties(@QueryParameter String properties) throws IOException {
51-
try {
52-
if (validPropertyNames==null) {
53-
// this computation depends on the implementation details of MySQL JDBC connector
54-
GroovyShell gs = new GroovyShell(getClass().getClassLoader());
55-
validPropertyNames = (Set<String>) gs.evaluate ( new InputStreamReader ( MySQLDatabase.class.getResourceAsStream ( "validate.groovy" ),
56-
Charset.forName ( "UTF-8" ) ) );
57-
}
58-
Properties props = Util.loadProperties(properties);
59-
for (Map.Entry e : props.entrySet()) {
60-
String key = e.getKey().toString();
61-
if (!validPropertyNames.contains(key))
62-
return FormValidation.error("Unrecognized property: "+key);
63-
}
64-
return FormValidation.ok();
65-
} catch (Throwable e) {
66-
return FormValidation.warning(e,"Failed to validate the connection properties");
67-
}
68-
}
6936
}
7037
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<div>
2-
Specify additional connection properties in the <tt>key=value</tt> format.
2+
Specify additional connection properties in the <code>key=value</code> format.
33
Lines beginning with '#' will be ignored as comments.
44
</div>

src/main/resources/org/jenkinsci/plugins/database/mysql/validate.groovy

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/test/java/org/jenkinsci/plugins/database/mysql/JenkinslessTest.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)