}
public Query getRandomIndexWordQuery(POS pos) throws JWNLException {
MinMax minMax = _minMaxIds.get(pos);
if (minMax == null) {
Query query = createPOSQuery(pos, COUNT_INDEX_WORDS_SQL);
try {
query.execute();
query.getResults().next();
minMax = new MinMax(query.getResults().getInt(1), query
.getResults().getInt(2));
_minMaxIds.put(pos, minMax);
} catch (SQLException ex) {
throw new JWNLException("DICTIONARY_EXCEPTION_023", ex);
} finally {
if (query != null) {
query.close();
}
}
}
int id = minMax.getMin()
+ _rand.nextInt(minMax.getMax() - minMax.getMin());