Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- public class Conexion {
- private static Conexion conexion;
- private Connection conection;
- private Conexion() {
- }
- public Connection conectar() throws SQLException {
- conection = null;
- conection = DriverManager.getConnection(
- "jdbc:mysql://127.0.0.1:3306/prueba_borja?useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC",
- "root", "");
- return conection;
- }
- public static Conexion getInstance() {
- if (conexion == null) {
- conexion = new Conexion();
- }
- return conexion;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement