public String getString(Object rs, int param) {
    String value;

    try {
      if (getDatabaseAdapter().supportsOption(RDBMSAdapter.BLOB_SET_USING_SETSTRING)) {
        value = ((ResultSet) rs).getString(param);
      } else {
        byte[] bytes = ((ResultSet) rs).getBytes(param);
        if (bytes == null) {
          value = null;
        } else {
          BlobImpl blob = new BlobImpl(bytes);
          value = (String) blob.getObject();
        }
      }
    } catch (SQLException e) {
      throw new NucleusDataStoreException(
          LOCALISER_RDBMS.msg("055002", "String", "" + param, column, e.getMessage()), e);
    }

    return value;
  }