Guest User

Untitled

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