下列代码中rs为查询得到的结果集,代码运行后表格的每一行有几个字段()
A: while(rs.next()){
B: out.print(rs.getString(1)+”\t”)
C: out.print(rs.getString(2)+”\t”)
D: out.print(rs.getString(3)+”\t”)
E: out.print(rs.getString("publish")++”\t”)
F: out.print(rs.getFloat("price")+"\n")G.}H.A.4I.B.5J.C.6K.D.不确定
A: while(rs.next()){
B: out.print(rs.getString(1)+”\t”)
C: out.print(rs.getString(2)+”\t”)
D: out.print(rs.getString(3)+”\t”)
E: out.print(rs.getString("publish")++”\t”)
F: out.print(rs.getFloat("price")+"\n")G.}H.A.4I.B.5J.C.6K.D.不确定
举一反三
- 下列代码中rs为查询得到的结果集,代码运行后表格的每一行有几个字段()while(rs.next()){out.print(rs.getString(1)+” ”);out.print(rs.getString(2) +” ”);out.print(rs.getString(3) +” ”);out.print(rs.getString("publish")++” ”);out.print(rs.getFloat("price")+" ");}
- 下列代码中rs为查询得到的结果集,代码运行后表格的每一行有几个单元格() while(rs.next()){ out.print(''); out.print(''+rs.getString(1)+'</td>'); out.print(''+rs.getString(2)+'</td>'); out.print(''+rs.getString(3)+'</td>'); out.print(''+rs.getString('publish')+'</td>'); out.print(''+rs.getFloat('price')+'</td>'); out.print('</tr>'); }
- 下列代码中rs为查询得到的结果集,代码运行后表格的每一行有 单元格。 while..."); out.print(""); }
- 【多选题】在JDBC编程中执行完下列SQL语句 SELECT name, rank, serialNo FROM employee, 能得到rs的第一列数据的代码是以下哪两项? (20.0分) A. rs.getString(0); B. rs.getString("name"); C. rs.getString(1); D. rs.getString("ename");
- 执行ResultSet rs = stmt.executeQuery ("select bid,name,author,publish,price from book");语句,得到的结果集rs的列数为( ) A: 4 B: 5 C: 6 D: 不确定