Guest User

Untitled

a guest
Nov 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import java.sql.*;
  2.  
  3. public class Driver {
  4.  
  5. public static void main(String[] args) {
  6. try {
  7.  
  8. Class.forName("com.mysql.jdbc.Driver");
  9.  
  10. Connection connect = DriverManager.getConnection("jbdc:mysql://localhost:3306/dongerino", "root", null);
  11.  
  12. Statement query = connect.createStatement();
  13.  
  14. ResultSet myquery = query.executeQuery("select * from personinfo");
  15.  
  16. while (myquery.next()) {
  17. System.out.println(myquery.getString("personName"));
  18. }
  19. }
  20. catch (Exception e) {
  21. e.printStackTrace();
  22. }
  23. }
  24.  
  25. java.sql.SQLException: No suitable driver found for jbdc:mysql://localhost:3306/dongerino
  26. at java.sql.DriverManager.getConnection(Unknown Source)
  27. at java.sql.DriverManager.getConnection(Unknown Source)
  28. at Driver.main(Driver.java:10)
Add Comment
Please, Sign In to add comment