Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package unsch.efpis.ConexionDB;
- import java.sql.Connection;
- import java.sql.Driver;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- /**
- *
- * @author sin_querer
- */
- public class Conexion {
- private static Connection cn = null;
- private static Driver driver = new org.apache.derby.jdbc.ClientDriver();
- private static String URLDerby = "jdbc:derby://localhost:1527/DBDerby";
- private static String usuario = "usuarioderby";
- private static String contrasena = "123456";
- public static Connection getConexion() throws SQLException {
- DriverManager.registerDriver(driver);
- cn = DriverManager.getConnection(URLDerby, usuario, contrasena);
- return cn;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement