Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. java.sql.SQLException: No suitable driver found for jdbc:mariadb://localhost:3306/mydatabase
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. import java.sql.SQLException;
  6.  
  7. public class CountryDAO {
  8.  
  9.  
  10. public list() throws SQLException, ClassNotFoundException{
  11. String databaseURL = "jdbc:mariadb://localhost:3306/mydatabase";
  12. String user = "root";
  13. String password = "root";
  14.  
  15. try
  16. {
  17. Connection connection = DriverManager.getConnection(databaseURL, user, password);
  18.  
  19. } catch (SQLException ex) {
  20. ex.printStackTrace();
  21. throw ex;
  22. }
  23.  
  24.  
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement