mirror of
https://github.com/simon987/music-graph-api.git
synced 2025-04-18 17:36:42 +00:00
open slqite readonly
This commit is contained in:
parent
4195aad139
commit
e72c830c14
@ -6,6 +6,7 @@ import org.glassfish.jersey.internal.inject.AbstractBinder;
|
|||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Properties;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
public class SQLiteCoverArtDatabase extends AbstractBinder implements ICoverArtDatabase {
|
public class SQLiteCoverArtDatabase extends AbstractBinder implements ICoverArtDatabase {
|
||||||
@ -77,14 +78,17 @@ public class SQLiteCoverArtDatabase extends AbstractBinder implements ICoverArtD
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setupConn() throws SQLException {
|
private void setupConn() throws SQLException {
|
||||||
|
Properties config = new Properties();
|
||||||
|
config.setProperty("open_mode", "1");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (connection == null || connection.isClosed()) {
|
if (connection == null || connection.isClosed()) {
|
||||||
logger.fine("Connecting to SQLite cover art DB");
|
logger.fine("Connecting to SQLite cover art DB");
|
||||||
connection = DriverManager.getConnection("jdbc:sqlite:" + dbFile);
|
connection = DriverManager.getConnection("jdbc:sqlite:" + dbFile, config);
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
logger.fine("Connecting to SQLite cover art DB");
|
logger.fine("Connecting to SQLite cover art DB");
|
||||||
connection = DriverManager.getConnection("jdbc:sqlite:" + dbFile);
|
connection = DriverManager.getConnection("jdbc:sqlite:" + dbFile, config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user