primero
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package eu.esa.gemis.anp.conexion;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ConexionDB {
|
||||
|
||||
public static Connection getConexion() throws SQLException {
|
||||
|
||||
try {
|
||||
Class.forName(ConfigConexion.get("db.driver"));
|
||||
|
||||
return DriverManager.getConnection(
|
||||
ConfigConexion.get("db.url"),
|
||||
ConfigConexion.get("db.user"),
|
||||
ConfigConexion.get("db.password")
|
||||
);
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new SQLException("No se ha encontrado el driver de la base de datos", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user