为了账号安全,请及时绑定邮箱和手机立即绑定

您的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!");

}

       


}


正在回答

1 回答

知道了,from打成form了

1 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

您的SQL语法有错误?????

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信