Advertisement
Guest User

Untitled

a guest
Feb 18th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. public class DbConncetion {
  2. public Connection Connect(){
  3. try {
  4. Class.forName("com.mysql.jdbc.Driver");
  5. Connection con= DriverManager.getConnection("jdbc:mysql://localhost:3306/cms?autoReconnect=true&useSSL=false","root","");
  6. return con;
  7. }
  8. catch(Exception ex){
  9. System.out.println(ex);
  10. }
  11. return null;
  12. }
  13.  
  14. }
  15.  
  16. com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
  17. java.lang.NullPointerException
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement