There is an error , it is cannot find Symbol
import java.sql.*;
public class Main {
public static void main(String[] args) {
try {
Class.forName("com.mysql.jdbc.Driver");
String connectionUrl = "jdbc:mysql://localhost/mytestdb?" +
"user=root&password=PHP";
Connection con = DriverManager.getConnection(connectionUrl);
} catch (SQLException e) {
System.out.println("SQL Exception: "+ e.toString());
} catch (ClassNotFoundException cE) {
System.out.println("Class Not Found Exception: "+ cE.toString());
}
Statement stmt = null;
ResultSet rs = null;
//SQL query command
String SQL = "SELECT * FROM user";
stmt = con.createStatement();
rs = stmt.executeQuery(SQL);
while (rs.next()) {
System.out.println(rs.getString("username") + " : " + rs.getString("password"));
}
}
}