打印ResultSet的结果 (范例)

・1 分钟阅读

打印java.sql.ResultSet的示例代码


ResultSet rs = statement.executeQuery();
 ResultSetMetaData rsmd = rs.getMetaData();
 System.out.println("querying SELECT * FROM XXX");
 int columnsNumber = rsmd.getColumnCount();
 while (rs.next()) {
 for (int i = 1; i
Xn_warm profile image