public Object[] readValue(Connection connection,Object[] keys){
  PreparedStatement statement=null;
  try {
    if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) {
      log.debug("Executing query '" + readSQL + "' for keys '"+ print(keys)+ "'");
    }
    statement=connection.prepareStatement(readSQL);
    for (int i=0; i < keys.length; i++) {
      statement.setObject(i + 1,keys[i]);
    }
    ResultSet rs=statement.executeQuery();
    if (!rs.next()) {
      return null;
    }
    Object[] row=new Object[valueFieldNames.length];
    for (int i=0; i < valueFieldNames.length; i++) {
      row[i]=DBUtil.getValue(rs,i + 1,valueTypes[i]);
    }
    return row;
  }
 catch (  SQLException ex) {
    String message="Failed to invoke : " + readSQL + " :"+ ex.getMessage();
    log.error(message,ex);
    storeExceptionHandler.handle(message,ex);
    throw new StoreExceptionDBRel(message,ex);
  }
 finally {
    try {
      if (statement != null)       statement.close();
    }
 catch (    SQLException e) {
    }
  }
}

public Object [ ] readValue ( Connection connection , Object [ ] keys ) { PreparedStatement statement = null ; try { if ( ( ExecutionPathDebugLog . isDebugEnabled ) && ( log . isDebugEnabled ( ) ) ) { log . debug ( "Executing query '" + readSQL + "' for keys '" + print ( keys ) + "'" ) ; } statement = connection . prepareStatement ( readSQL ) ; for ( int i = 0 ; i < keys . length ; i ++ ) { statement . setObject ( i + 1 , keys [ i ] ) ; } ResultSet rs = statement . executeQuery ( ) ; if ( ! rs . next ( ) ) { return null ; } Object [ ] row = new Object [ valueFieldNames . length ] ; for ( int i = 0 ; i < valueFieldNames . length ; i ++ ) { row [ i ] = DBUtil . getValue ( rs , i + 1 , valueTypes [ i ] ) ; } return row ; } catch ( SQLException ex ) { String message = "Failed to invoke : " + readSQL + " :" + ex . getMessage ( ) ; log . error ( message , ex ) ; storeExceptionHandler . handle ( message , ex ) ; throw new StoreExceptionDBRel ( message , ex ) ; } finally { try { if ( statement != null ) statement . close ( ) ; } catch ( SQLException e ) { } } }
read value returning null if not found or the value ( which can also be null ) .
