Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Conexion Conectar()
- {
- try {
- Class.forName("oracle.jdbc.OracleDriver");
- String bd = "jdbc:oracle:thin:@localhost:1521:XE";
- conexion = DriverManager.getConnection(bd,"inventario","system");
- if(conexion != null){
- System.out.println("conexion exitosa");
- }else{
- System.out.println("conexion fallida");
- }
- } catch (SQLException e) {
- System.out.println("ERROR SQL: "+e.getMessage());
- } catch(Exception ex){
- System.out.println("OTRO ERROR: "+ex.getMessage());
- }
- return this;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement