Performance issue while retriving data

Joined
May 28, 2012
Messages
1
Reaction score
0
Hi
I am new in java can anybody suggest another logic to save and retrieve data other than ArrayList as i have tried that also but it causes not an impact on as mentioned below because it causing a huge memory issue .

Vector vctSrepID = new Vector();
Vector vctSrep = new Vector();
Vector vctSrpNum = new Vector();
Vector vctEnpbuDom = new Vector();
Vector vctEnpbuExp = new Vector();
Vector vctEnpbuTot = new Vector();
Vector vctEarnAdjDom = new Vector();
Vector vctEarnAdjExp = new Vector();
Vector vctEarnAdjTot = new Vector();
Vector vctPaylessDom = new Vector();
Vector vctPaylessExp = new Vector();
Vector vctPaylessTot = new Vector();
Vector vctPWEarnAdjDom = new Vector();
Vector vctPWEarnAdjExp = new Vector();
Vector vctPWEarnAdjTot = new Vector();
Vector vctPWPaylessDom = new Vector();
Vector vctPWPaylessExp = new Vector();
Vector vctPWPaylessTot = new Vector();
Vector vctEnpauDom = new Vector();
Vector vctEnpauExp = new Vector();
Vector vctEnpauTot = new Vector();
Vector vctChkAmtDom= new Vector();
Vector vctChkAmtExp= new Vector();
Vector vctChkAmtTot= new Vector();
Vector vctPWChkAmtDom= new Vector();
Vector vctPWChkAmtExp= new Vector();
Vector vctPWChkAmtTot= new Vector();
Vector vctMemoDom = new Vector();
Vector vctMemoExp = new Vector();
Vector vctMemoTot = new Vector();



//Query Fetches Domestic, Export and Totals for Earnings and Adjustments, Payables Less and Check Amount


strSql = "SELECT query1.SALESREP_ID, query1.SALESREP_NUMBER, query1.SALESREP_NAME " +
" ,'.00' ENPBUDOM ,'.00' ENPBUEXP ,'.00' ENPBUTOT " +
" ,trim(to_char(sum(domestic_ea), 99999999999999.99)) " +
" ,trim(to_char(sum(export_ea), 99999999999999.99)) " +
" ,trim(to_char((sum(export_ea) + sum(domestic_ea)), 99999999999999.99)) " +
" ,trim(to_char(sum(domestic_cp), 99999999999999.99)) " +
" ,trim(to_char(sum(export_cp), 99999999999999.99)) " +
" ,trim(to_char((sum(export_cp) + sum(domestic_cp)), 99999999999999.99)) " +
" , '.00' ENPAUDOM ,'.00' ENPAUEXP ,'.00' ENABUTOT " +
" ,'.00' MEMODOM ,'.00' MEMOEXP ,'.00' MEMOTOT " +
" FROM( " +
" SELECT xics.salesrep_id SALESREP_ID " +
" ,xics.EMPLOYEE_NUMBER SALESREP_NUMBER " +
" ,xics.SALESREP_NAME SALESREP_NAME " +
" , decode(Export_indicator, 'YES', sum(nvl(earned_commission,0) + nvl(earned_commission_adjustment,0)), 0) EXPORT_EA " +
" , decode(Export_indicator, 'NO', sum(nvl(earned_commission,0) + nvl(earned_commission_adjustment,0)), 0) DOMESTIC_EA " +
" , decode(Export_indicator, 'YES', sum(nvl(commission_payable,0) + nvl(clawback_commission,0)), 0) EXPORT_CP " +
" , decode(Export_indicator, 'NO', sum(nvl(commission_payable,0) + nvl(clawback_commission,0)), 0) DOMESTIC_CP " +
" FROM xxcn_inv_comm_summary_v xics " +
" WHERE 1 = 1 " + strSqlParam1 +
" GROUP BY xics.salesrep_id, xics.EMPLOYEE_NUMBER ,xics.SALESREP_NAME, export_indicator " +
" ) query1 " +
" GROUP BY query1.SALESREP_ID, query1.SALESREP_NUMBER, query1.SALESREP_NAME ";


stmt = (OraclePreparedStatement) connect.prepareStatement(strSql);

rs = stmt.executeQuery(strSql);



//Populate the vectors with the fetched data
while (rs.next()) {
vctSrepID.addElement(rs.getString(1));
vctSrpNum.addElement(rs.getString(2));
vctSrep.addElement(rs.getString(3));
vctEnpbuDom.addElement(rs.getString(4));
vctEnpbuExp.addElement(rs.getString(5));
vctEnpbuTot.addElement(rs.getString(6));
vctEarnAdjDom.addElement(rs.getString(7));
vctEarnAdjExp.addElement(rs.getString(8));
vctEarnAdjTot.addElement(rs.getString(9));
vctPaylessDom.addElement(rs.getString(10));
vctPaylessExp.addElement(rs.getString(11));
vctPaylessTot.addElement(rs.getString(12));
vctEnpauDom.addElement(rs.getString(13));
vctEnpauExp.addElement(rs.getString(14));
vctEnpauTot.addElement(rs.getString(15));
vctMemoDom.addElement(rs.getString(16));
vctMemoExp.addElement(rs.getString(17));
vctMemoTot.addElement(rs.getString(18));




Thanks in Advance
Manju
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top