throws Exception
{
String idSql = dbAdapter.getSequenceSql(keyInfo);
// Execute the query.
QueryDataSet qds = new QueryDataSet( connection, idSql );
Record rec;
try
{
qds.fetchRecords(1);
rec = qds.getRecord(0); // Records are 0 based.
}
finally
{
if (qds != null) qds.close();
}
return rec.getValue(1); // Values are 1 based.
}