单项选择题

程序填空题: 从数据库student表中查询所有学生并放入ArrayList中。 Connection con=null; Statement stmt=null; ResultSet rs=null; String uri = "jdbc:mysql://localhost:3306/st"; List<student> list=new ArrayList<student>(); try { 【 1 】=DriverManager.getConnection(uri,"root",""); 【 2 】=con.createStatement(); rs=stmt.【 3 】(“【 4 】sname,sid,score from student”); while(rs.next()) { Student s=new Student(); s.sname=rs.【 5 】(“sname”); s.sid=rs.【 5 】(“sid”); s.score=rs.getFloat(“score”); list.add(s); } rs.close; stmt.close(); con.close(); } catch(SQLException e) { System.out.println(e.getMessage()); }

A.getConnection(uri,"root","");
B.createStatement();
C.【
D.next())
E.sname=rs.【
F.sid=rs.【
G.score=rs.getFloat(“score”);
H.add(s);
I.close;
J.close();
K.close();
L.out.println(e.getMessage());
题目列表

你可能感兴趣的试题

问答题

设备运转时,操作工人可以短时间离开岗位()

A.正确
B.错误
答案: B.错误设备运转时,操作工人必须时刻在岗,以便监控设备运行状态,及时处理可能出现的异常情况,确保设备安全和生产安全。离开...
问答题

项目所指的三横是珠外环高速公路、将军大街、G321国道()

A.正确
B.错误
答案: B.错误"三横"通常是指某个地区或项目中三条主要的横向交通干线或基础设施。由于您提供的信息中没有具体的项目背景,无法确定...
微信扫码免费搜题