单项选择题
程序填空题: 从数据库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());