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

Infer MariaDB JDBC Driver from URL #65

Merged
merged 1 commit into from
May 6, 2021
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 @@ -115,6 +115,8 @@ public static String inferDriverClassName(String url) {
return "org.sqlite.JDBC";
case "mysql":
return "com.mysql.cj.jdbc.Driver";
case "mariadb":
return "org.mariadb.jdbc.Driver";
case "postgresql":
return "org.postgresql.Driver";
case "sqlserver":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ public void testInferDriverClassName_mysql() throws Exception {
assertEquals("com.mysql.cj.jdbc.Driver", driverClassName);
}

@Test
public void testInferDriverClassName_mariadb() throws Exception {
String driverClassName = JdbcUtil.inferDriverClassName("jdbc:mariadb://localhost:3306/hoge");
assertEquals("org.mariadb.jdbc.Driver", driverClassName);
}

@Test
public void testInferDriverClassName_unknown() throws Exception {
String driverClassName = JdbcUtil.inferDriverClassName("jdbc:unknown://localhost/hoge");
Expand Down