题目内容
{在【1】-【5】处填写代码,使得程序能实现显示数据表student的内容。public class Demo175 {public static void main(String[] args) {try{Class.forName("oracle.jdbc.driver.OracleDriver");String url = "jdbc:oracle:thin:@localhost:1521:MyDB";Connection conn = ____【1】(url, "root", "root");Statement ____【2】;String sql = "select * from student";ResultSet rs = ____【3】;int i=0;while(____【4】){System.out.print((++i)+"\t");System.out.print(rs.getString("stuNo")+"\t");System.out.print(rs.getString("stuName")+"\t");System.out.println(rs.getDouble("score"));}____【5】;stmt.close();conn.close();}catch (SQLException e) {e.printStackTrace();} catch (ClassNotFoundException e){e.printStackTrace();}}}}
查看答案
搜索结果不匹配?点我反馈
更多问题