+ public static List<List<Object>> getSQLArrayObjectsEx(String trxName, String sql, Object... params) {
+ List<List<
+ PreparedStatement pstmt = null;
+ ResultSet rs = null;
+ try
+ {
+ pstmt = prepareStatement(sql, trxName);
+
+ rs = pstmt.executeQuery();
+ ResultSetMetaData rsmd = rs.getMetaData();
+ while (rs.next()) {
+ List<
+ for (int i=1; i<=rsmd.getColumnCount(); i++) {
+ Object obj = rs.getObject(i);
+ if (rs.wasNull())
+ retValue.add(null);
+ else
+ retValue.add(obj); // 欄位矩陣
+ }
+
+ }
+ }
+ catch (SQLException e)
+ {
+ throw new DBException(e, sql);
+ }
+ finally
+ {
+ close(rs, pstmt);
+ rs = null; pstmt = null;
+ }
+ if (rowsArray.size() == 0)
+ return null;
+ return rowsArray; // 陣列: 欄位矩陣
+ }
+
} // DB