Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- class createtable
- {
- public static void main(String args[])throws Exception
- {
- try
- {
- Class.forName("com.mysql.jdbc.Driver");
- Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/VCE","root","eswecha");
- 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 is not created");
- }
- catch(Exception e)
- {
- System.out.println(e);
- }
- }
- }
Add Comment
Please, Sign In to add comment