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 

2016年7月6日 星期三

發散式的會計科目規屬定義:::::::::::::

發散式的會計科目規屬定義:::::::::::::
String sql =
"SELECT P_Revenue_Acct, P_Expense_Acct, P_Asset_Acct, P_Cogs_Acct, " // 1..4
+ "P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, "         // 5..6
+"P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct " // 7..8
+   "FROM M_Product_Acct "
+ "WHERE M_Product_ID=? "
+      "AND C_AcctSchema_ID=? ";

並不是歸屬到一個對應 會計規屬定義類別