/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package pkgLogica;
import java.sql.*;
/**
*
* @author grosales
*/
public class Conexion {
Connection cn = null;
PreparedStatement pstmt = null;
ResultSet result = null;
int fila = 0;
String sql = "";
//Constructor
public Conexion(){
try {
Class.forName("org.postgresql.Driver").newInstance();
System.out.println("Driver instalado");
//Para conectarse a la base de datos de clases
//cn = DriverManager.getConnection("jdbc:postgresql://172.16.3.77/portal_web","postgres","sistemas");
//Para conectarse a la base de datos local
cn = DriverManager.getConnection("jdbc:postgresql://localhost/portal_web","postgres","sistemas");
System.out.println("Base conectada");
} catch (Exception exception) {
System.out.println("Error::" + exception.getMessage());
}
}
}
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario