Guest User

Untitled

a guest
Mar 1st, 2019
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import java.sql.*;
  2. class createtable
  3. {
  4. public static void main(String args[])throws Exception
  5. {
  6. try
  7. {
  8. Class.forName("com.mysql.jdbc.Driver");
  9. Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/VCE","root","eswecha");
  10. Statement s=con.createStatement();
  11. boolean b=s.execute("create table emp(eno int(10),ename varchar(15))");
  12. if(b==false)
  13. System.out.println("table created");
  14. else
  15. System.out.println("table is not created");
  16. }
  17. catch(Exception e)
  18. {
  19. System.out.println(e);
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment