Guest User

Untitled

a guest
Jun 26th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1.  
  2. import java.sql.Connection;
  3. import java.sql.DriverManager;
  4. import java.sql.ResultSet;
  5. import java.sql.SQLException;
  6. import java.sql.Statement;
  7. import java.util.logging.Level;
  8. import java.util.logging.Logger;
  9.  
  10. public class DataBase{
  11.  
  12.     Connection connection;
  13.     Statement query;
  14.  
  15.     public DataBase(){
  16.         try {
  17.             Class.forName("com.mysql.jdbc.Driver");
  18.             connection = DriverManager.getConnection("jdbc:mysql://path","databaseUser", "databasePass");
  19.         } catch (SQLException ex) {
  20.             Logger.getLogger(DataBase.class.getName()).log(Level.SEVERE, null, ex);
  21.         } catch (ClassNotFoundException ex) {
  22.             Logger.getLogger(DataBase.class.getName()).log(Level.SEVERE, null, ex);
  23.         }
  24.     }
Add Comment
Please, Sign In to add comment