View Single Post
Old 10-25-2005, 07:57 PM   #1 (permalink)
kkiub
Registered User
 
Join Date: Oct 2005
Posts: 3
kkiub is on a distinguished road
movefirst in java

hi guys,

i need your help. i need to point cursor to my first record in my resultset. but no function movefirst in java. this in my code:
Code:
public SPO RetrievePOHdr (String cSQL) throws RemoteException {
    SPO PO = new SPO();			
    try {
	  DBConnection dbconn = new DBConnection ();
	  stmt = dbconn.getConn().createStatement();
	  sql = "SELECT * ";
	  sql = sql + " FROM pu_ordhdrfc, outer pu_ordlinefc ";
	  sql = sql + " WHERE puoh_company = puol_company ";
	  sql = sql + " and puoh_ordid = puol_ordid ";
	  sql = sql + cSQL;
	  rs = stmt.executeQuery(sql);
	  rs.movefirst(); --- error
	  String ordDate,expDate;
	  DateConvert dc = new DateConvert();
	  ordDate= dc.getStrdate((rs.getString("puoh_orddate")),"DBtoJSP");
	  expDate= dc.getStrdate((rs.getString("puoh_expdate")),"DBtoJSP");
	  PO.setcompany(rs.getString("puoh_company"));
	  PO.setordid(rs.getString("puoh_ordid"));
	  PO.setcontractid(rs.getString("puoh_contractid"));
	  PO.setsuppid(rs.getString("puoh_suppid"));
    }catch (SQLException ee) {
      System.out.println("error retrieve:" +ee);
    }
    return PO;
}
please help me.

Last edited by Belisarius; 10-26-2005 at 01:02 AM. Reason: Beautified code
kkiub is offline   Reply With Quote