* @since 3.0
*/
public Address getAddress(JDCConnection oConn, String sTpLocation)
throws SQLException,IllegalStateException {
Address oRetAdr;
if (isNull(DB.gu_company))
throw new IllegalStateException("Company.getAddress([Connection],"+sTpLocation+") gu_company property is not set");
if (DebugFile.trace) {
DebugFile.writeln("Begin Company.getAddress([Connection],"+sTpLocation+")" );
DebugFile.incIdent();
}
PreparedStatement oStmt = oConn.prepareStatement("SELECT x." + DB.gu_address +
" FROM " + DB.k_x_company_addr + " x," +
DB.k_addresses + " a WHERE " +
"x." + DB.gu_address + "=a." + DB.gu_address +
" AND x." + DB.gu_company+"=?" +
" AND a." + DB.tp_location+"=?",
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
oStmt.setString(1, getString(DB.gu_company));
oStmt.setString(2, sTpLocation);
ResultSet oRSet = oStmt.executeQuery();
if (oRSet.next())
oRetAdr = new Address(oConn, oRSet.getString(1));
else
oRetAdr = null;
oRSet.close();
oStmt.close();