Advertisement
Guest User

Untitled

a guest
Jun 9th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. package Library;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. import java.sql.SQLException;
  6.  
  7. public class Database {
  8. public Connection con;
  9. public Connection getCon(){
  10. try {
  11. Class.forName("com.mysql.jdbc.Driver");
  12. con = DriverManager.getConnection("jdbc:mysql://localhost:3306/OrderProcessingSystem", "root", "11feb2011");
  13. } catch (ClassNotFoundException e) {
  14. // TODO Auto-generated catch block
  15. e.printStackTrace();
  16. } catch (SQLException e) {
  17. // TODO Auto-generated catch block
  18. e.printStackTrace();
  19. }
  20. return con;
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement