代码拉取完成,页面将自动刷新
public class diyige {
public static void main(String args[]){
Connection con=null;
Statement sql;
ResultSet rs;
try{
Class.forName("com.mysql.jdbc.Driver");
}
catch (Exception e){
}
String uri ="jdbc:mysql://localhost:3306/students?useSSL=true";
String user ="root";
String password ="";
try{
con = DriverManager.getConnection(uri,user,password);
}
catch(SQLException e){}
try{
sql = con.createStatement();
rs=sql.executeQuery("SELECT *FROM mess");
while(rs.next()){
String number=rs.getString(1);
String name=rs.getString(2);
Date data=rs.getDate(3);
float height=rs.getFloat(4);
System.out.print(number);
System.out.print(name);
System.out.print(data);
System.out.print(height);
}
con.close();
}
catch(SQLException e){
System.out.println(e);
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。