Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DbConncetion {
- public Connection Connect(){
- try {
- Class.forName("com.mysql.jdbc.Driver");
- Connection con= DriverManager.getConnection("jdbc:mysql://localhost:3306/cms?autoReconnect=true&useSSL=false","root","");
- return con;
- }
- catch(Exception ex){
- System.out.println(ex);
- }
- return null;
- }
- }
- com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
- java.lang.NullPointerException
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement