Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/Store
- Class.forName("com.mysql.jdbc.Driver");
- public void connectToDB(){
- try{
- String URL = "jdbc:mysql://localhost:3306/Store";
- String username = "root";
- String password = "sesame";
- Connection connection = DriverManager.getConnection(URL, username, password);
- System.out.println("DB has been connected!!!!!!!!!!!!!!!!!!");
- }catch(SQLException ex){
- for(Throwable t : ex){
- t.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement