Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.Connection;
- import java.sql.DriverManager;
- public void realizaConexion(){
- Connection conn = null;
- String urlDatabase = "jdbc:postgresql://localhost:0000/midatabase";
- try {
- Class.forName("org.postgresql.Driver");
- conn = DriverManager.getConnection(urlDatabase, "usuario", "password");
- } catch (Exception e) {
- System.err.println("Ocurrio un error : "+e.getMessage());
- }
- System.out.println("La conexión se realizo sin problemas! =) ");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement