Advertisement
Guest User

Untitled

a guest
Jul 4th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. package database;
  2. import java.sql.Connection;
  3. import java.sql.DriverManager;
  4. import java.sql.ResultSet;
  5. import java.sql.SQLException;
  6. import java.sql.Statement;
  7. /*
  8. * @author nitish
  9. */
  10. public class Database {
  11. public static void main(String[] args) {
  12. // TODO code application logic here
  13. try{
  14. Class.forName("com.mysql.jdbc.Driver");
  15. Connection con=DriverManager.getConnection(
  16. "jdbc:mysql://localhost:3306/nitish","root","");
  17. Statement stmt=con.createStatement();
  18. System.out.println("Connectede Successfully");
  19. }catch( ClassNotFoundException | SQLException e){
  20. System.out.println(e);
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement