Click here to Skip to main content
13,401,175 members (49,690 online)
Rate this:
 
Please Sign up or sign in to vote.
public ArrayList<Object> getOrderInvoiceHeaders(String query) {

OutOrderOrInvoiceHeaderDO headerDO = null;

ArrayList<Object> arrayList = null;
try {
		arrayList = new ArrayList<Object>();
		headerDO = new OutOrderOrInvoiceHeaderDO();
			Global.dbObj.openDataBase();

			Cursor cursor = Global.dbObj.execQuery(query);
			if (cursor != null) {
				while (cursor.moveToNext()) {

					headerDO.docNumber = (String.valueOf(cursor
							.getString(cursor.getColumnIndex("DocNumber"))));
					headerDO.customerNumber = (String.valueOf(cursor
							.getInt(cursor.getColumnIndex("CustomerNumber"))));
					headerDO.grossSales = (String.valueOf(cursor.getInt(cursor
							.getColumnIndex("GrossSales"))));
					headerDO.totalTaxes = (String.valueOf(cursor.getInt(cursor
							.getColumnIndex("TotalTaxes"))));
					headerDO.netAmount = (String.valueOf(cursor.getInt(cursor
							.getColumnIndex("NetAmount"))));
					headerDO.routeNumber = (String.valueOf(cursor
							.getString(cursor.getColumnIndex("RouteNumber"))));
					headerDO.employeeNumber = (String
							.valueOf(cursor.getString(cursor
									.getColumnIndex("EmployeeNumber"))));
				}

			}
			cursor.close();

			System.out.println(arrayList.size());

		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			Global.dbObj.close();
		}
		return arrayList;
	}
Posted 3-Dec-12 2:41am

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

I solved my self just before few days

public OutOrderOrInvoiceHeaderDO<Object> getOrderInvoiceHeaders(String query) {

OutOrderOrInvoiceHeaderDO headerDO = null;

// convert arraylist in object
//pass that in headerDO


return headerDO;
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web04 | 2.8.180218.2 | Last Updated 8 Dec 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100