View difference between Paste ID: NVj2BsXF and HUHjKUES
SHOW: | | - or go back to the newest paste.
1
package unsch.efpis.ConexionDB;
2
3
import java.sql.Connection;
4
import java.sql.Driver;
5
import java.sql.DriverManager;
6
import java.sql.SQLException;
7
8
/**
9
 *
10
 * @author sin_querer
11
 */
12
public class Conexion {
13
    private static Connection cn = null;
14
    private static Driver driver = new org.apache.derby.jdbc.ClientDriver();
15
    private static String URLDerby = "jdbc:derby://localhost:1527/DBDerby";
16-
    private static String usuario = "nbuser";
16+
    private static String usuario = "usuarioderby";
17-
    private static String contrasena = "nbuser";
17+
    private static String contrasena = "123456";
18
    
19
    public static Connection getConexion() throws SQLException {
20
        DriverManager.registerDriver(driver);
21
        cn = DriverManager.getConnection(URLDerby, usuario, contrasena);
22
        return cn;
23
    }
24
}