mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-30 10:47:33 +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 {
|
public class MySQLStorage extends SQLStorage {
|
||||||
|
|
||||||
private static final String JDBC_PROTOCOL = "jdbc:";
|
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,
|
public MySQLStorage(FastLoginCore<?, ?, ?> core, String driver, String host, int port, String database,
|
||||||
HikariConfig config, boolean useSSL) {
|
HikariConfig config, boolean useSSL) {
|
||||||
@ -40,6 +42,12 @@ public class MySQLStorage extends SQLStorage {
|
|||||||
private static HikariConfig setParams(HikariConfig config,
|
private static HikariConfig setParams(HikariConfig config,
|
||||||
String driver, String host, int port, String database,
|
String driver, String host, int port, String database,
|
||||||
boolean useSSL) {
|
boolean useSSL) {
|
||||||
|
if ("mysql".equalsIgnoreCase(driver.trim())) {
|
||||||
|
config.setDriverClassName(MYSQL_DRIVER);
|
||||||
|
} else if ("mariadb".equalsIgnoreCase(driver.trim())) {
|
||||||
|
config.setDriverClassName(MARIADB_DRIVER);
|
||||||
|
}
|
||||||
|
|
||||||
config.setDriverClassName(driver);
|
config.setDriverClassName(driver);
|
||||||
|
|
||||||
// Require SSL on the server if requested in config - this will also verify certificate
|
// 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
|
// vs the default: yyyy-MM-dd HH:mm:ss.SSS
|
||||||
SQLiteConfig sqLiteConfig = new SQLiteConfig();
|
SQLiteConfig sqLiteConfig = new SQLiteConfig();
|
||||||
sqLiteConfig.setDateStringFormat("yyyy-MM-dd HH:mm:ss");
|
sqLiteConfig.setDateStringFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
// sqLiteConfig.setDatePrecision("seconds");
|
|
||||||
|
|
||||||
config.addDataSourceProperty("config", sqLiteConfig);
|
config.addDataSourceProperty("config", sqLiteConfig);
|
||||||
|
|
||||||
|
2
pom.xml
2
pom.xml
@ -56,7 +56,7 @@
|
|||||||
<maven.compiler.release>${java.version}</maven.compiler.release>
|
<maven.compiler.release>${java.version}</maven.compiler.release>
|
||||||
|
|
||||||
<floodgate.version>2.2.0-SNAPSHOT</floodgate.version>
|
<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>
|
</properties>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
@ -144,7 +144,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mariadb.jdbc</groupId>
|
<groupId>org.mariadb.jdbc</groupId>
|
||||||
<artifactId>mariadb-java-client</artifactId>
|
<artifactId>mariadb-java-client</artifactId>
|
||||||
<version>3.0.6</version>
|
<version>3.0.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
Reference in New Issue
Block a user