Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- class createJDBC
- {
- public static void main(String[] args)
- {
- String url="jdbc:mysql://localhost:3306/VCE";
- String userName="root";
- String password="eswecha";
- Class.forName("com.mysql.jdbc.Driver");
- Connection con=DriverManager.getConnection(url,userName,password);
- Statement s=con.createStatement();
- boolean b=s.execute("create table emp(eno int(10),ename varchar(15);");
- if(b==false)
- System.out.println("table created");
- else
- System.out.println("table not created");
- con.close();
- s.close();
- }
- }
Add Comment
Please, Sign In to add comment