if (rowkey.missingValues()) {
throw new IncompleteKeyException(rowkey.getMissing());
}
RowVal ret = dbev.new RowVal();
Connection conn = dbev.dataSource.getConnection();
PreparedStatement stmt = null;
try {
if (__log.isDebugEnabled()) __log.debug("Prepare statement: " + dbev.select);
stmt = conn.prepareStatement(dbev.select);
int idx = 1;
for (Object k : rowkey) {
if (__log.isDebugEnabled()) __log.debug("Set key parameter "+idx+": "+k);
stmt.setObject(idx++, k);
}
ResultSet rs = stmt.executeQuery();
try {
if (rs.next()) {
for (Column c : dbev._columns) {
Object val;
int i = c.idx+1;
if (c.isDate()) val = rs.getDate(i);
else if (c.isTimeStamp()) val = rs.getTimestamp(i);
else if (c.isTime()) val = rs.getTime(i);
else if (c.isInteger()) val = new Long(rs.getLong(i));
else if (c.isReal()) val = new Double(rs.getDouble(i));
else if (c.isBoolean()) val = new Boolean(rs.getBoolean(i));
else val = rs.getObject(i);
if (__log.isDebugEnabled()) __log.debug("Result column index "+c.idx+": "+val);
ret.set(c.idx,val);
}
} else
return null;
} finally {
rs.close();