SQLBuffer tables = new SQLBuffer(dict).append(_seqColumn.getTable());
SQLBuffer select = dict.toSelect(sel, null, tables, where, null,
null, null, false, dict.supportsSelectForUpdate, 0, Long.MAX_VALUE);
PreparedStatement stmnt = select.prepareStatement(conn);
ResultSet rs = null;
try {
rs = stmnt.executeQuery();
if (!rs.next())
return -1;