import java.sql.Connection ;
import java.sql.DriverManager ;
import java.sql.Statement ;
public class shiyan4{
public static final String DBDRIVER = "org.gjt.mm.mysql.Driver" ;
public static final String DBURL = "jdbc:mysql://localhost:3306/ace" ;
public static final String DBUSER = "root" ;
public static final String DBPASS = "root" ;
public static void main(String args[]) throws Exception {
Connection conn = null ;
Statement stmt = null ;
Class.forName(DBDRIVER) ;
String sql = "SELECT user_name FROM users;";
conn = DriverManager.getConnection(DBURL,DBUSER,DBPASS) ;
stmt = conn.createStatement() ;
stmt.executeUpdate(sql) ;
stmt.close() ;
conn.close() ;
}
}
请问这样怎么修改才能正常的进行查询 和在java上输出查询到的信息