Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.forge;
- import java.sql.Connection;
- import java.sql.DriverManager;
- public class Main {
- public static void main(String[] args) {
- // nombre = Juan Perez
- // rut= 25.542.569-8
- // user = jperez
- // password = P25.54
- // url = forgedb.netbyteoss.com
- // puerto = 5443
- // base de datos = forge_alumnos
- try {
- try {
- Class.forName("org.postgresql.Driver");
- } catch (ClassNotFoundException ex) {
- System.out.println("Error, el driver de PostgresSQL no se ha cargado : " + ex);
- }
- Connection conn = null;
- // Conectamos con la base de datos
- conn = DriverManager.getConnection(
- "jdbc:postgresql://forgedb.netbyteoss.com:5443/forge_alumnos",
- "jperez", "P25.54"
- );
- } catch (java.sql.SQLException sqle) {
- System.out.println("Error:" + sqle);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement