Advertisement
Guest User

Untitled

a guest
Jan 26th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/Store
  2.  
  3. Class.forName("com.mysql.jdbc.Driver");
  4.  
  5. public void connectToDB(){
  6.  
  7.  
  8. try{
  9. String URL = "jdbc:mysql://localhost:3306/Store";
  10. String username = "root";
  11. String password = "sesame";
  12.  
  13. Connection connection = DriverManager.getConnection(URL, username, password);
  14. System.out.println("DB has been connected!!!!!!!!!!!!!!!!!!");
  15. }catch(SQLException ex){
  16. for(Throwable t : ex){
  17. t.printStackTrace();
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement