daily pastebin goal
91%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Loading class 'com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is
  2.    
  3. public void cargarClaves(){
  4.     cbxNumCte.removeAllItems();
  5.     Connection conn = null;
  6.     Statement stm = null;
  7.     ResultSet rs = null;
  8.     try{
  9.         Class.forName("com.mysql.cj.jdbc.Driver");
  10.     }
  11.     catch(ClassNotFoundException ex){
  12.         ex.printStackTrace();
  13.         System.exit(-1);
  14.     }
  15.     try{
  16.         conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1/aimx?autoReconnect=true&useSSL=false","admin","admin");
  17.         stm = conn.createStatement();
  18.         rs = stm.executeQuery("SELECT NumCte FROM clientes");
  19.         while(rs.next()) {
  20.             cbxNumCte.addItem(rs.getString(1));
  21.         }
  22.     }
  23.     catch(SQLException exc){
  24.         JOptionPane.showMessageDialog(null, "Hubo problemas accediendo a la base de datos", "Borrar Clientes", JOptionPane.ERROR_MESSAGE);
  25.         exc.printStackTrace();
  26.         //System.exit(-1);
  27.     }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top