Guest User

jugy

a guest
Feb 21st, 2019
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import java.sql.*;
  2. class prgm1
  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/santhosh","root","eswecha");
  10. Statement st=con.createStatement();
  11. boolean b=st.execute("create table emp("+"eno int,"+"ename varchar(10))");
  12. if(b==false)
  13. System.out.println("table created");
  14. else
  15. System.out.println("not created");
  16. }
  17. catch(Exception e)
  18. {
  19. System.out.println(e);
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment