Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void createTables(){
- Connection con = null;
- try{
- Class.forName("com.mysql.jdbc.Driver");
- con = DriverManager.getConnection("jdbc:mysql://localhost/ablog","root","dick4");
- try{
- Statement st = con.createStatement();
- String t="CREATE TABLE attempts (indexnumber integer unsigned auto_increment not null, date date not null, buy boolean not null default '0', itemname text not null";
- st.executeUpdate(t);
- System.out.println("Table creation process successfully!");
- }
- catch (SQLException s){
- System.out.println("SQL statement "+which+" is not executed!");
- }
- }
- catch (Exception e){
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement