Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- public class Driver {
- public static void main(String[] args) {
- try {
- Class.forName("com.mysql.jdbc.Driver");
- Connection connect = DriverManager.getConnection("jbdc:mysql://localhost:3306/dongerino", "root", null);
- Statement query = connect.createStatement();
- ResultSet myquery = query.executeQuery("select * from personinfo");
- while (myquery.next()) {
- System.out.println(myquery.getString("personName"));
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
- java.sql.SQLException: No suitable driver found for jbdc:mysql://localhost:3306/dongerino
- at java.sql.DriverManager.getConnection(Unknown Source)
- at java.sql.DriverManager.getConnection(Unknown Source)
- at Driver.main(Driver.java:10)
Add Comment
Please, Sign In to add comment