mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-29 18:27:36 +02:00
Resolve the mysql driver if using the simplified version
This commit is contained in:
@ -31,6 +31,8 @@ import com.zaxxer.hikari.HikariConfig;
|
||||
public class MySQLStorage extends SQLStorage {
|
||||
|
||||
private static final String JDBC_PROTOCOL = "jdbc:";
|
||||
private static final String MYSQL_DRIVER = "com.mysql.cj.jdbc.Driver";
|
||||
private static final String MARIADB_DRIVER = "fastlogin.mariadb.jdbc.Driver";
|
||||
|
||||
public MySQLStorage(FastLoginCore<?, ?, ?> core, String driver, String host, int port, String database,
|
||||
HikariConfig config, boolean useSSL) {
|
||||
@ -40,6 +42,12 @@ public class MySQLStorage extends SQLStorage {
|
||||
private static HikariConfig setParams(HikariConfig config,
|
||||
String driver, String host, int port, String database,
|
||||
boolean useSSL) {
|
||||
if ("mysql".equalsIgnoreCase(driver.trim())) {
|
||||
config.setDriverClassName(MYSQL_DRIVER);
|
||||
} else if ("mariadb".equalsIgnoreCase(driver.trim())) {
|
||||
config.setDriverClassName(MARIADB_DRIVER);
|
||||
}
|
||||
|
||||
config.setDriverClassName(driver);
|
||||
|
||||
// Require SSL on the server if requested in config - this will also verify certificate
|
||||
|
@ -62,7 +62,6 @@ public class SQLiteStorage extends SQLStorage {
|
||||
// vs the default: yyyy-MM-dd HH:mm:ss.SSS
|
||||
SQLiteConfig sqLiteConfig = new SQLiteConfig();
|
||||
sqLiteConfig.setDateStringFormat("yyyy-MM-dd HH:mm:ss");
|
||||
// sqLiteConfig.setDatePrecision("seconds");
|
||||
|
||||
config.addDataSourceProperty("config", sqLiteConfig);
|
||||
|
||||
|
2
pom.xml
2
pom.xml
@ -56,7 +56,7 @@
|
||||
<maven.compiler.release>${java.version}</maven.compiler.release>
|
||||
|
||||
<floodgate.version>2.2.0-SNAPSHOT</floodgate.version>
|
||||
<geyser.version>2.0.5-SNAPSHOT</geyser.version>
|
||||
<geyser.version>2.0.6-SNAPSHOT</geyser.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
|
@ -144,7 +144,7 @@
|
||||
<dependency>
|
||||
<groupId>org.mariadb.jdbc</groupId>
|
||||
<artifactId>mariadb-java-client</artifactId>
|
||||
<version>3.0.6</version>
|
||||
<version>3.0.7</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
Reference in New Issue
Block a user