Advertisement
Guest User

sqlbros.sqlmg

a guest
Feb 23rd, 2015
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. package de.heu.craft.sql.bro;
  2.  
  3. import java.sql.SQLException;
  4. import java.sql.Statement;
  5.  
  6. import code.husky.mysql.MySQL;
  7.  
  8. public class sqlmg {
  9.     private final main mein;
  10.     private MySQL db;
  11.     public sqlmg(main h){
  12.         this.mein = h;
  13.     }
  14.    
  15.     public void setupDB() throws SQLException{
  16.         this.db = new MySQL(this.mein,"127.0.0.1","3306","test",
  17.                 "test", "Asdfasdf1");
  18.         this.db.getConnection();
  19.         Statement statement = this.db.getConnection().createStatement();
  20.         statement.executeUpdate("CREATE TABLE IF NOT EXISTS `test` (`name` varchar(32),`uses` int)");
  21.     }
  22.     public void closeDB() throws SQLException{
  23.         this.db.closeConnection();
  24.     }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement