mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-30 10:47:33 +02:00
@ -184,5 +184,12 @@
|
|||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<version>2.9.1</version>
|
<version>2.9.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.xerial</groupId>
|
||||||
|
<artifactId>sqlite-jdbc</artifactId>
|
||||||
|
<version>3.36.0.3</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
@ -37,6 +37,8 @@ import java.util.UUID;
|
|||||||
import java.util.concurrent.locks.Lock;
|
import java.util.concurrent.locks.Lock;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
|
import org.sqlite.SQLiteConfig;
|
||||||
|
|
||||||
public class SQLiteStorage extends SQLStorage {
|
public class SQLiteStorage extends SQLStorage {
|
||||||
|
|
||||||
private static final String SQLITE_DRIVER = "org.sqlite.SQLiteDataSource";
|
private static final String SQLITE_DRIVER = "org.sqlite.SQLiteDataSource";
|
||||||
@ -52,11 +54,14 @@ public class SQLiteStorage extends SQLStorage {
|
|||||||
config.setConnectionTestQuery("SELECT 1");
|
config.setConnectionTestQuery("SELECT 1");
|
||||||
config.setMaximumPoolSize(1);
|
config.setMaximumPoolSize(1);
|
||||||
|
|
||||||
config.addDataSourceProperty("databaseName", path);
|
config.addDataSourceProperty("url", path);
|
||||||
|
|
||||||
// a try to fix https://www.spigotmc.org/threads/fastlogin.101192/page-26#post-1874647
|
// a try to fix https://www.spigotmc.org/threads/fastlogin.101192/page-26#post-1874647
|
||||||
// format strings retrieved by the timestamp column to match them from MySQL
|
// format strings retrieved by the timestamp column to match them from MySQL
|
||||||
config.addDataSourceProperty("date_string_format", "yyyy-MM-dd HH:mm:ss");
|
// vs the default: yyyy-MM-dd HH:mm:ss.SSS
|
||||||
|
SQLiteConfig sqLiteConfig = new SQLiteConfig();
|
||||||
|
sqLiteConfig.setDateStringFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
config.addDataSourceProperty("config", config);
|
||||||
|
|
||||||
// TODO: test first for compatibility
|
// TODO: test first for compatibility
|
||||||
// config.addDataSourceProperty("date_precision", "seconds");
|
// config.addDataSourceProperty("date_precision", "seconds");
|
||||||
|
Reference in New Issue
Block a user