Examples of DDNameValue


Examples of com.centraview.common.DDNameValue

    try {
      if (locationCollection != null) {
        StringBuffer stringBuffer = new StringBuffer();
        Iterator it = locationCollection.iterator();
        while (it.hasNext()) {
          DDNameValue sourceObject = (DDNameValue) it.next();
          // System.out.println("[DEBUG] [AppSettingsEJB]: sourceObject: " +
          // sourceObject.toString());
          if (sourceObject.getName() != null && sourceObject.getId() == -1) {
            // create a new Source Record
            cvdl.setSqlQueryToNull();
            cvdl.setSqlQuery("INSERT INTO location (title) VALUES (?)");
            cvdl.setString(1, sourceObject.getName());
            cvdl.executeUpdate();
            int newId = cvdl.getAutoGeneratedKey();
            stringBuffer.append(newId);
          } // end of if statement (sourceObject.getName() != null ...
          else if (sourceObject.getName() != null) {
            // update the existing Source Record
            cvdl.setSqlQueryToNull();
            cvdl.setSqlQuery("UPDATE location SET title = ? WHERE locationid = ?");
            cvdl.setString(1, sourceObject.getName());
            cvdl.setInt(2, sourceObject.getId());
            cvdl.executeUpdate();
            stringBuffer.append(sourceObject.getId());
          } // end of else if statement (sourceObject.getName() != null)
          if (stringBuffer.length() > 0 && it.hasNext()) {
            stringBuffer.append(", ");
          }
        } // end of while loop (it.hasNext())
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.