Cambiada el nombre de la propiedad para la base de datos actual.
Ademas ahora si no se pueda obtener el jdbc el programa simplemente se cerrara ya que es un estado en el cual no se puede continuar
This commit is contained in:
@@ -24,8 +24,9 @@
|
||||
|
||||
package danielcortes.xyz.data;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public interface ConnectionHolder {
|
||||
java.sql.Connection getConnection() throws SQLException;
|
||||
Connection getConnection() throws SQLException;
|
||||
}
|
||||
|
||||
@@ -32,16 +32,21 @@ public class SQLiteConnectionHolder implements ConnectionHolder {
|
||||
private String databaseURI;
|
||||
|
||||
public SQLiteConnectionHolder() {
|
||||
this.databaseURI = Configuration.get("database_uri");
|
||||
this.databaseURI = Configuration.get("sqlite_database_uri");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connection getConnection() throws SQLException {
|
||||
Connection con = null;
|
||||
|
||||
try {
|
||||
Class.forName("org.sqlite.JDBC");
|
||||
con = DriverManager.getConnection(databaseURI);
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
System.exit(133);
|
||||
}
|
||||
return DriverManager.getConnection(databaseURI);
|
||||
|
||||
return con;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user