· 8 years ago · Dec 28, 2017, 06:30 AM
1void checkCreateMeth()
2 {
3 try{
4 System.out.println("Implementing the functionality of create table if not exist or not.");
5 Class.forName(JDBC_Driver);
6 con=DriverManager.getConnection(DB_URL, user, pass);
7 stmt=con.createStatement();
8 String sql="CREATE TABLE IF NOT EXISTS VGRWER(name varchar(10),stream varchar(10))";
9 int rs=stmt.executeUpdate(sql);
10 System.out.println("Value of rs is="+rs);
11 }catch(Exception e)
12 {
13 e.printStackTrace();
14 }
15 }