Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.21 KB | None | 0 0
  1. Connection mysqlConnection = new Connection("localhost", "root",
  2.                     "letmein", 3306, "my_database", new IConnectionInterface()
  3.             {
  4.                 @Override
  5.                 public void actionCompleted()
  6.                 {
  7.                     //You are now connected to the database
  8.                 }
  9.  
  10.                 @Override
  11.                 public void handleInvalidSQLPacketException(InvalidSQLPacketException e)
  12.                 {
  13.                     //Handle the error
  14.                 }
  15.  
  16.                 @Override
  17.                 public void handleMySQLException(MySQLException e)
  18.                 {
  19.                     //Handle the error
  20.                 }
  21.  
  22.                 @Override
  23.                 public void handleIOException(IOException e)
  24.                 {
  25.                     //Handle the error
  26.                 }
  27.  
  28.                 @Override
  29.                 public void handleMySQLConnException(MySQLConnException e)
  30.                 {
  31.                     //Handle the error
  32.                 }
  33.  
  34.                 @Override
  35.                 public void handleException(Exception e)
  36.                 {
  37.                     //Handle the error
  38.                 }
  39.             });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement