2016年7月9日 星期六

陣列 : 欄位矩陣 : rowsArray



+        public static List<List<Object>> getSQLArrayObjectsEx(String trxName, String sql, Object... params) { 
+            List<List<Object>> rowsArray = new ArrayList<List<Object>>();  // 陣列: 欄位矩陣
+            PreparedStatement pstmt = null; 
+            ResultSet rs = null; 
+            try 
+            { 
+                    pstmt = prepareStatement(sql, trxName); 
+                    setParameters(pstmt, params); 
+                    rs = pstmt.executeQuery(); 
+                    ResultSetMetaData rsmd = rs.getMetaData(); 
+                    while (rs.next()) { 
+                            List<Object> retValue = new ArrayList<Object>();  // 欄位矩陣
+                            for (int i=1; i<=rsmd.getColumnCount(); i++) { 
+                                Object obj = rs.getObject(i); 
+                                if (rs.wasNull()) 
+                                    retValue.add(null); 
+                                else 
+                                    retValue.add(obj); // 欄位矩陣
+                            } 
+                            rowsArray.add(retValue); // 陣列: 欄位矩陣
+                    } 
+            } 
+            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 

1 則留言:

  1. Play and play casino games online from the popular online casino site with many popular online casino games such as Baccarat Slots, online casinos, roulette, roulette, gourmet crabs Online casino games Golden slot can be played live online through the website. Or play through a program installed on your computer or computer. Ensure that you play casino online with us. Gclub69 you will enjoy the fun of many online casino games that we have gathered and also get comfortable. No need to play to the casino, you can really enjoy online casino games easily by playing and betting through the site. สล็อตออนไลน์ Six clubs gclub can be played anywhere, anytime, 24 hours. In addition, we also have. The prototype of the online multiplayer horoscope game. To help the gambler, all of the games have come to create a bonus from the game to play online gambling games have come to overwhelm the game for you to entertain. Online has the most challenging.

    回覆刪除