· 9 years ago · Nov 21, 2016, 12:04 PM
1/*
2 String tableDropQuery = "DROP TABLE IF EXISTS Employee_Details";
3 String tableCreateQuery = "CREATE TABLE Employee_Details (firstName VARCHAR(20),lastName VARCHAR(20),age INT,employeeID INT NOT NULL";
4 Statement stmt = null;
5 try{
6 Connection conn = getConnection();
7 stmt = conn.createStatement();
8 stmt.executeUpdate(tableDropQuery);
9 int result = stmt.executeUpdate(tableCreateQuery);
10 if(result == 0)
11 System.out.println("Table created successfully!");
12 else
13 System.out.println("Oops!");
14 }catch(Exception e){
15 e.printStackTrace();
16 } finally{
17 if(stmt!=null)
18 stmt.close();
19 if(conn!=null)
20 conn.close();
21 }
22 */