Files
AgenciaESA---Avelino-Navarro/src/eu/esa/gemis/anp/conexion/ConexionDB.java
T
2026-11-10 20:11:10 +01:00

25 lines
620 B
Java

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);
}
}
}