Ejemplo n.º 1
0
 /**
  * Helper class to write an person attribute if needed
  *
  * @param name name of the attribute
  * @param element element that the attribute will be added to
  * @param rs ResultSet than includes the values of the attribute
  * @throws SQLException
  * @throws Exception
  */
 private static void writeMovieAtt(String name, XMLElement element, ResultSet rs)
     throws SQLException, Exception {
   if (rs.next()) {
     element.addAttribute(name, "M" + rs.getString(1));
     while (rs.next()) {
       element.appendAttribute(name, "M" + rs.getString(1));
     }
   }
 }
Ejemplo n.º 2
0
  /**
   * Helper class to write an Oscar attribute if needed
   *
   * @param name Name of the attribute
   * @param element the element that the attribute will be added to
   * @param rs the result set that includes the values of the attributes
   * @throws SQLException
   * @throws Exception
   */
  private static void writeOscarAtt(String name, XMLElement element, ResultSet rs)
      throws SQLException, Exception {
    String oscAtt = "";

    if (rs.next()) {
      if (rs.getString(2) == null) {
        oscAtt = "O" + rs.getString(1) + "0000000";
      } else {
        oscAtt = "O" + rs.getString(1) + rs.getString(2);
      }
      element.addAttribute(name, oscAtt);
      while (rs.next()) {
        if (rs.getString(2) == null) {
          oscAtt = "O" + rs.getString(1) + "0000000";
        } else {
          oscAtt = "O" + rs.getString(1) + rs.getString(2);
        }
        element.appendAttribute(name, oscAtt);
      }
    }
  }