您的SQL语法有错误?????
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class Skt {
/**
* @param args
*/
//JDBC
private static final String DB_URL = "jdbc:mysql://localhost:3306/association?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8";
private static final String USERNAME="root";
private static final String PASSWORD="135511";
public static void main(String[] args) throws Exception {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection con= DriverManager.getConnection(DB_URL, USERNAME, PASSWORD);
Statement stmt=con.createStatement();
ResultSet rt= stmt.executeQuery("select name ,url form websites ");
while(rt.next()){
System.out.println(rt.getString("name")+","+rt.getString("url"));
}
System.out.println("Goodbye!");
}
}