Topic
  • 7 replies
  • Latest Post - ‏2014-07-04T02:04:13Z by Xian Huang
SystemAdmin
SystemAdmin
445 Posts

Pinned topic Custom EDS Service Example from Redbook

‏2012-12-27T16:17:10Z |
Hi, I am working on the Custom EDS Service example from Redbook "Customizing and Extending
IBM Content Navigator" which is on chapter 8.
On 8.6 Deployment and configuration, page 263, I am stuck at step 4, during deployment.
It says: "select the JDBC data source reference, for example jdbc/CIWEBDS and the deployment root /customEDSService."
I am unable to select the JDBC data source reference on WAS Integrated Solutions Console.
Any help is appreciated, thanks.
Updated on 2013-01-22T08:10:00Z at 2013-01-22T08:10:00Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    445 Posts

    Re: Custom EDS Service Example from Redbook

    ‏2012-12-27T18:18:21Z  
    This may not answer your original issue, but WAS 8.6 is not supported for ICN. WAS 8.0 and 8.5 are supported for ICN 2.0.1. WAS 8.5 is not supported for ICN 2.0.0.
  • SystemAdmin
    SystemAdmin
    445 Posts

    Re: Custom EDS Service Example from Redbook

    ‏2012-12-28T12:48:47Z  
    This may not answer your original issue, but WAS 8.6 is not supported for ICN. WAS 8.0 and 8.5 are supported for ICN 2.0.1. WAS 8.5 is not supported for ICN 2.0.0.
    I am using WAS 7.0
  • SystemAdmin
    SystemAdmin
    445 Posts

    Re: Custom EDS Service Example from Redbook

    ‏2013-01-03T16:23:48Z  
    I just went past that step and it worked for me. Just make sure that the datasource that you have in WebSphere matches what you put in the EDS.
  • SystemAdmin
    SystemAdmin
    445 Posts

    Re: Custom EDS Service Example from Redbook

    ‏2013-01-21T16:04:32Z  
    I just went past that step and it worked for me. Just make sure that the datasource that you have in WebSphere matches what you put in the EDS.
    Hi
    I followed the directions of the redbook but I still do not get results. The connection to the db is ok , also the select to two tables, but on the field I have indicated in the tables do not provide any choichelist. It is possible that there is an error in the code of procedure getpropretyData?

    private JSONArray getPropertyData(String objectType, Locale locale) {
    JSONArray jsonPropertyData = new JSONArray();
    Connection con = null;
    String Sql="";
    try {
    Context ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/EDSDB");
    //DataSource ds = (DataSource) ctx.lookup("java:jdbc/comp/env/CIWEBDS");
    con = ds.getConnection();
    // Query the database for EDS data
    Statement stmt = con.createStatement();
    Sql="SELECT " + edsTable
    + ".OBJECTTYPE," + edsTable + ".PROPERTY," + edsTable
    + ".DISPMODE," + edsTable + ".REQUIRED," + edsTable
    + ".HIDDEN," + edsTable + ".MAXVAL," + edsTable
    + ".MINVAL," + edsTable + ".MAXLEN," + edsTable
    + ".FORMAT," + edsTable + ".FORMATDESC," + edsTable
    + ".HASDEPENDANT," + edsChoicesTable + ".LISTDISPNAME,"
    + edsChoicesTable + ".DISPNAME," + edsChoicesTable
    + ".VALUE," + edsChoicesTable + ".DEPON," + edsChoicesTable
    + ".DEPVALUE" + " FROM " + schema + '.' + edsTable + ' '
    + edsTable + " LEFT JOIN " + schema + '.' + edsChoicesTable
    + ' ' + edsChoicesTable + " ON " + edsTable
    + ".OBJECTTYPE=" + edsChoicesTable + ".OBJECTTYPE"
    + " AND " + edsTable + ".PROPERTY=" + edsChoicesTable
    + ".PROPERTY" + " AND " + edsChoicesTable + ".LANG='"
    + locale + "'" + " where " + edsTable + ".OBJECTTYPE='"
    + objectType + "'" + " ORDER BY " + edsChoicesTable
    + ".DEPON," + edsChoicesTable + ".DEPVALUE";

    ResultSet results = stmt.executeQuery(Sql);

    String property = null;
    String listDispName = null;
    boolean firstLoop = true;
    String dependentOn = null;
    String dependentValue = null;
    JSONObject propertyJson = new JSONObject();
    JSONObject choiceList = new JSONObject();
    JSONArray choices = new JSONArray();
    // iterate through the EDS data and build the corresponding JSON
    while (results.next()) {

    String propertyTemp =results.getString("property");
    System.out.println("UpdateObjectTypeServlet property="+propertyTemp);
    if (firstLoop) {
    property = propertyTemp;
    listDispName = results.getString("listdispname");
    propertyJson = fillBasicProperties(results, property);
    firstLoop = false;
    }
    // check if the property is different to the one
    // in the previous loop
    if (!propertyTemp.equals(property)) {
    if (!choices.isEmpty()) {
    System.out.println("UpdateObjectTypeServlet pASSO 5.1");
    choiceList.put("displayName", listDispName);
    choiceList.put("choices", choices);
    propertyJson.put("choiceList", choiceList);
    listDispName = results.getString("listdispname");
    choiceList = new JSONObject();
    choices = new JSONArray();
    }
    jsonPropertyData.add(propertyJson);
    property = propertyTemp;
    propertyJson = fillBasicProperties(results, property);
    }
    String listDispNameTemp = results.getString("listdispname");
    if (!results.wasNull()) {
    if (!listDispNameTemp.equals(listDispName)) {
    choiceList.put("displayName", listDispName);
    choiceList.put("choices", choices);
    propertyJson.put("choiceList", choiceList);
    // close property, add to array and create new
    jsonPropertyData.add(propertyJson);
    listDispName = listDispNameTemp;
    choiceList = new JSONObject();
    choices = new JSONArray();
    }
    } else {
    // no choice list attached, continue to next loop
    continue;
    }
    String dependentOnTemp = results.getString("depon");
    String dependentValueTemp = results.getString("depvalue");
    // check if there is a dependenOn/Value
    // set for the choice list
    if ((null != dependentOnTemp && null != dependentValueTemp
    && !dependentOnTemp.isEmpty() && !dependentValueTemp
    .isEmpty())) {
    // historic values are null, set dependentOn/dependentValue
    if (null == dependentOn && null == dependentValue) {
    dependentOn = dependentOnTemp;
    dependentValue = dependentValueTemp;
    propertyJson.put("dependentOn", dependentOn);
    propertyJson.put("dependentValue", dependentValue);
    } else {
    // historic values are not null but different,
    // start new dependent list
    if (!dependentOnTemp.equals(dependentOn)
    || !dependentValueTemp.equals(dependentValue)) {
    dependentOn = dependentOnTemp;
    dependentValue = dependentValueTemp;
    propertyJson = fillBasicProperties(results,
    property);
    propertyJson.put("dependentOn", dependentOn);
    propertyJson.put("dependentValue", dependentValue);
    }
    }
    }
    JSONObject choice = new JSONObject();
    choice.put("displayName", results.getString("dispname"));
    choice.put("value", results.getString("value"));
    choices.add(choice);
    }
    // add the last property
    jsonPropertyData.add(propertyJson);
    stmt.close();
    con.close();
    } catch (NamingException e) {
    e.printStackTrace();
    } catch (SQLException se) {
    System.out.println("SQL Exception:");
    // Loop through the SQL Exceptions
    while (se != null) {
    System.out.println("State : " + se.getSQLState());
    System.out.println("Message: " + se.getMessage());
    System.out.println("Error : " + se.getErrorCode());
    se = se.getNextException();
    }
    } finally {
    try {
    if (null != con && !con.isClosed())
    con.close();
    } catch (SQLException se) {
    System.out.println("SQL Exception:");
    // Loop through the SQL Exceptions
    while (se != null) {
    System.out.println("State : " + se.getSQLState());
    System.out.println("Message: " + se.getMessage());
    System.out.println("Error : " + se.getErrorCode());
    se = se.getNextException();
    }
    }
    }

    return jsonPropertyData;
    }
  • Nicoolas
    Nicoolas
    21 Posts

    Re: Custom EDS Service Example from Redbook

    ‏2013-01-21T17:46:12Z  
    Hi
    I followed the directions of the redbook but I still do not get results. The connection to the db is ok , also the select to two tables, but on the field I have indicated in the tables do not provide any choichelist. It is possible that there is an error in the code of procedure getpropretyData?

    private JSONArray getPropertyData(String objectType, Locale locale) {
    JSONArray jsonPropertyData = new JSONArray();
    Connection con = null;
    String Sql="";
    try {
    Context ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/EDSDB");
    //DataSource ds = (DataSource) ctx.lookup("java:jdbc/comp/env/CIWEBDS");
    con = ds.getConnection();
    // Query the database for EDS data
    Statement stmt = con.createStatement();
    Sql="SELECT " + edsTable
    + ".OBJECTTYPE," + edsTable + ".PROPERTY," + edsTable
    + ".DISPMODE," + edsTable + ".REQUIRED," + edsTable
    + ".HIDDEN," + edsTable + ".MAXVAL," + edsTable
    + ".MINVAL," + edsTable + ".MAXLEN," + edsTable
    + ".FORMAT," + edsTable + ".FORMATDESC," + edsTable
    + ".HASDEPENDANT," + edsChoicesTable + ".LISTDISPNAME,"
    + edsChoicesTable + ".DISPNAME," + edsChoicesTable
    + ".VALUE," + edsChoicesTable + ".DEPON," + edsChoicesTable
    + ".DEPVALUE" + " FROM " + schema + '.' + edsTable + ' '
    + edsTable + " LEFT JOIN " + schema + '.' + edsChoicesTable
    + ' ' + edsChoicesTable + " ON " + edsTable
    + ".OBJECTTYPE=" + edsChoicesTable + ".OBJECTTYPE"
    + " AND " + edsTable + ".PROPERTY=" + edsChoicesTable
    + ".PROPERTY" + " AND " + edsChoicesTable + ".LANG='"
    + locale + "'" + " where " + edsTable + ".OBJECTTYPE='"
    + objectType + "'" + " ORDER BY " + edsChoicesTable
    + ".DEPON," + edsChoicesTable + ".DEPVALUE";

    ResultSet results = stmt.executeQuery(Sql);

    String property = null;
    String listDispName = null;
    boolean firstLoop = true;
    String dependentOn = null;
    String dependentValue = null;
    JSONObject propertyJson = new JSONObject();
    JSONObject choiceList = new JSONObject();
    JSONArray choices = new JSONArray();
    // iterate through the EDS data and build the corresponding JSON
    while (results.next()) {

    String propertyTemp =results.getString("property");
    System.out.println("UpdateObjectTypeServlet property="+propertyTemp);
    if (firstLoop) {
    property = propertyTemp;
    listDispName = results.getString("listdispname");
    propertyJson = fillBasicProperties(results, property);
    firstLoop = false;
    }
    // check if the property is different to the one
    // in the previous loop
    if (!propertyTemp.equals(property)) {
    if (!choices.isEmpty()) {
    System.out.println("UpdateObjectTypeServlet pASSO 5.1");
    choiceList.put("displayName", listDispName);
    choiceList.put("choices", choices);
    propertyJson.put("choiceList", choiceList);
    listDispName = results.getString("listdispname");
    choiceList = new JSONObject();
    choices = new JSONArray();
    }
    jsonPropertyData.add(propertyJson);
    property = propertyTemp;
    propertyJson = fillBasicProperties(results, property);
    }
    String listDispNameTemp = results.getString("listdispname");
    if (!results.wasNull()) {
    if (!listDispNameTemp.equals(listDispName)) {
    choiceList.put("displayName", listDispName);
    choiceList.put("choices", choices);
    propertyJson.put("choiceList", choiceList);
    // close property, add to array and create new
    jsonPropertyData.add(propertyJson);
    listDispName = listDispNameTemp;
    choiceList = new JSONObject();
    choices = new JSONArray();
    }
    } else {
    // no choice list attached, continue to next loop
    continue;
    }
    String dependentOnTemp = results.getString("depon");
    String dependentValueTemp = results.getString("depvalue");
    // check if there is a dependenOn/Value
    // set for the choice list
    if ((null != dependentOnTemp && null != dependentValueTemp
    && !dependentOnTemp.isEmpty() && !dependentValueTemp
    .isEmpty())) {
    // historic values are null, set dependentOn/dependentValue
    if (null == dependentOn && null == dependentValue) {
    dependentOn = dependentOnTemp;
    dependentValue = dependentValueTemp;
    propertyJson.put("dependentOn", dependentOn);
    propertyJson.put("dependentValue", dependentValue);
    } else {
    // historic values are not null but different,
    // start new dependent list
    if (!dependentOnTemp.equals(dependentOn)
    || !dependentValueTemp.equals(dependentValue)) {
    dependentOn = dependentOnTemp;
    dependentValue = dependentValueTemp;
    propertyJson = fillBasicProperties(results,
    property);
    propertyJson.put("dependentOn", dependentOn);
    propertyJson.put("dependentValue", dependentValue);
    }
    }
    }
    JSONObject choice = new JSONObject();
    choice.put("displayName", results.getString("dispname"));
    choice.put("value", results.getString("value"));
    choices.add(choice);
    }
    // add the last property
    jsonPropertyData.add(propertyJson);
    stmt.close();
    con.close();
    } catch (NamingException e) {
    e.printStackTrace();
    } catch (SQLException se) {
    System.out.println("SQL Exception:");
    // Loop through the SQL Exceptions
    while (se != null) {
    System.out.println("State : " + se.getSQLState());
    System.out.println("Message: " + se.getMessage());
    System.out.println("Error : " + se.getErrorCode());
    se = se.getNextException();
    }
    } finally {
    try {
    if (null != con && !con.isClosed())
    con.close();
    } catch (SQLException se) {
    System.out.println("SQL Exception:");
    // Loop through the SQL Exceptions
    while (se != null) {
    System.out.println("State : " + se.getSQLState());
    System.out.println("Message: " + se.getMessage());
    System.out.println("Error : " + se.getErrorCode());
    se = se.getNextException();
    }
    }
    }

    return jsonPropertyData;
    }
    Hi, can you please post what your JSON looks like after you build it?
  • SystemAdmin
    SystemAdmin
    445 Posts

    Re: Custom EDS Service Example from Redbook

    ‏2013-01-22T08:10:00Z  
    • Nicoolas
    • ‏2013-01-21T17:46:12Z
    Hi, can you please post what your JSON looks like after you build it?
    the code in Redbook for the choiche list works only if in the EDS table I insert at least two rows item type-attribute even if I want the choiche list only one of the two Es NOINDEX-SOURCE (whit list) -NOINDEX USER_ID (no list)
  • Xian Huang
    Xian Huang
    9 Posts

    Re: Custom EDS Service Example from Redbook

    ‏2014-07-04T02:04:13Z  
    Hi
    I followed the directions of the redbook but I still do not get results. The connection to the db is ok , also the select to two tables, but on the field I have indicated in the tables do not provide any choichelist. It is possible that there is an error in the code of procedure getpropretyData?

    private JSONArray getPropertyData(String objectType, Locale locale) {
    JSONArray jsonPropertyData = new JSONArray();
    Connection con = null;
    String Sql="";
    try {
    Context ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/EDSDB");
    //DataSource ds = (DataSource) ctx.lookup("java:jdbc/comp/env/CIWEBDS");
    con = ds.getConnection();
    // Query the database for EDS data
    Statement stmt = con.createStatement();
    Sql="SELECT " + edsTable
    + ".OBJECTTYPE," + edsTable + ".PROPERTY," + edsTable
    + ".DISPMODE," + edsTable + ".REQUIRED," + edsTable
    + ".HIDDEN," + edsTable + ".MAXVAL," + edsTable
    + ".MINVAL," + edsTable + ".MAXLEN," + edsTable
    + ".FORMAT," + edsTable + ".FORMATDESC," + edsTable
    + ".HASDEPENDANT," + edsChoicesTable + ".LISTDISPNAME,"
    + edsChoicesTable + ".DISPNAME," + edsChoicesTable
    + ".VALUE," + edsChoicesTable + ".DEPON," + edsChoicesTable
    + ".DEPVALUE" + " FROM " + schema + '.' + edsTable + ' '
    + edsTable + " LEFT JOIN " + schema + '.' + edsChoicesTable
    + ' ' + edsChoicesTable + " ON " + edsTable
    + ".OBJECTTYPE=" + edsChoicesTable + ".OBJECTTYPE"
    + " AND " + edsTable + ".PROPERTY=" + edsChoicesTable
    + ".PROPERTY" + " AND " + edsChoicesTable + ".LANG='"
    + locale + "'" + " where " + edsTable + ".OBJECTTYPE='"
    + objectType + "'" + " ORDER BY " + edsChoicesTable
    + ".DEPON," + edsChoicesTable + ".DEPVALUE";

    ResultSet results = stmt.executeQuery(Sql);

    String property = null;
    String listDispName = null;
    boolean firstLoop = true;
    String dependentOn = null;
    String dependentValue = null;
    JSONObject propertyJson = new JSONObject();
    JSONObject choiceList = new JSONObject();
    JSONArray choices = new JSONArray();
    // iterate through the EDS data and build the corresponding JSON
    while (results.next()) {

    String propertyTemp =results.getString("property");
    System.out.println("UpdateObjectTypeServlet property="+propertyTemp);
    if (firstLoop) {
    property = propertyTemp;
    listDispName = results.getString("listdispname");
    propertyJson = fillBasicProperties(results, property);
    firstLoop = false;
    }
    // check if the property is different to the one
    // in the previous loop
    if (!propertyTemp.equals(property)) {
    if (!choices.isEmpty()) {
    System.out.println("UpdateObjectTypeServlet pASSO 5.1");
    choiceList.put("displayName", listDispName);
    choiceList.put("choices", choices);
    propertyJson.put("choiceList", choiceList);
    listDispName = results.getString("listdispname");
    choiceList = new JSONObject();
    choices = new JSONArray();
    }
    jsonPropertyData.add(propertyJson);
    property = propertyTemp;
    propertyJson = fillBasicProperties(results, property);
    }
    String listDispNameTemp = results.getString("listdispname");
    if (!results.wasNull()) {
    if (!listDispNameTemp.equals(listDispName)) {
    choiceList.put("displayName", listDispName);
    choiceList.put("choices", choices);
    propertyJson.put("choiceList", choiceList);
    // close property, add to array and create new
    jsonPropertyData.add(propertyJson);
    listDispName = listDispNameTemp;
    choiceList = new JSONObject();
    choices = new JSONArray();
    }
    } else {
    // no choice list attached, continue to next loop
    continue;
    }
    String dependentOnTemp = results.getString("depon");
    String dependentValueTemp = results.getString("depvalue");
    // check if there is a dependenOn/Value
    // set for the choice list
    if ((null != dependentOnTemp && null != dependentValueTemp
    && !dependentOnTemp.isEmpty() && !dependentValueTemp
    .isEmpty())) {
    // historic values are null, set dependentOn/dependentValue
    if (null == dependentOn && null == dependentValue) {
    dependentOn = dependentOnTemp;
    dependentValue = dependentValueTemp;
    propertyJson.put("dependentOn", dependentOn);
    propertyJson.put("dependentValue", dependentValue);
    } else {
    // historic values are not null but different,
    // start new dependent list
    if (!dependentOnTemp.equals(dependentOn)
    || !dependentValueTemp.equals(dependentValue)) {
    dependentOn = dependentOnTemp;
    dependentValue = dependentValueTemp;
    propertyJson = fillBasicProperties(results,
    property);
    propertyJson.put("dependentOn", dependentOn);
    propertyJson.put("dependentValue", dependentValue);
    }
    }
    }
    JSONObject choice = new JSONObject();
    choice.put("displayName", results.getString("dispname"));
    choice.put("value", results.getString("value"));
    choices.add(choice);
    }
    // add the last property
    jsonPropertyData.add(propertyJson);
    stmt.close();
    con.close();
    } catch (NamingException e) {
    e.printStackTrace();
    } catch (SQLException se) {
    System.out.println("SQL Exception:");
    // Loop through the SQL Exceptions
    while (se != null) {
    System.out.println("State : " + se.getSQLState());
    System.out.println("Message: " + se.getMessage());
    System.out.println("Error : " + se.getErrorCode());
    se = se.getNextException();
    }
    } finally {
    try {
    if (null != con && !con.isClosed())
    con.close();
    } catch (SQLException se) {
    System.out.println("SQL Exception:");
    // Loop through the SQL Exceptions
    while (se != null) {
    System.out.println("State : " + se.getSQLState());
    System.out.println("Message: " + se.getMessage());
    System.out.println("Error : " + se.getErrorCode());
    se = se.getNextException();
    }
    }
    }

    return jsonPropertyData;
    }

    Hi, there are some missing code in here. You need add some red line code as follow.

    private JSONArray getPropertyData(String objectType, Locale locale) {
    JSONArray jsonPropertyData = new JSONArray();
    Connection con = null;
    String Sql="";
    try {
    Context ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/EDSDB");
    //DataSource ds = (DataSource) ctx.lookup("java:jdbc/comp/env/CIWEBDS"); 
    con = ds.getConnection();
    // Query the database for EDS data
    Statement stmt = con.createStatement();
    Sql="SELECT " + edsTable
    + ".OBJECTTYPE," + edsTable + ".PROPERTY," + edsTable
    + ".DISPMODE," + edsTable + ".REQUIRED," + edsTable
    + ".HIDDEN," + edsTable + ".MAXVAL," + edsTable
    + ".MINVAL," + edsTable + ".MAXLEN," + edsTable
    + ".FORMAT," + edsTable + ".FORMATDESC," + edsTable
    + ".HASDEPENDANT," + edsChoicesTable + ".LISTDISPNAME,"
    + edsChoicesTable + ".DISPNAME," + edsChoicesTable
    + ".VALUE," + edsChoicesTable + ".DEPON," + edsChoicesTable
    + ".DEPVALUE" + " FROM " + schema + '.' + edsTable + ' '
    + edsTable + " LEFT JOIN " + schema + '.' + edsChoicesTable
    + ' ' + edsChoicesTable + " ON " + edsTable
    + ".OBJECTTYPE=" + edsChoicesTable + ".OBJECTTYPE"
    + " AND " + edsTable + ".PROPERTY=" + edsChoicesTable
    + ".PROPERTY" + " AND " + edsChoicesTable + ".LANG='"
    + locale + "'" + " where " + edsTable + ".OBJECTTYPE='"
    + objectType + "'" + " ORDER BY " + edsChoicesTable
    + ".DEPON," + edsChoicesTable + ".DEPVALUE";

    ResultSet results = stmt.executeQuery(Sql);

    String property = null;
    String listDispName = null;
    boolean firstLoop = true;
    String dependentOn = null;
    String dependentValue = null;
    JSONObject propertyJson = new JSONObject();
    JSONObject choiceList = new JSONObject();
    JSONArray choices = new JSONArray();
    // iterate through the EDS data and build the corresponding JSON
    while (results.next()) {

    String propertyTemp =results.getString("property");
    System.out.println("UpdateObjectTypeServlet property="+propertyTemp);
    if (firstLoop) {
    property = propertyTemp;
    listDispName = results.getString("listdispname");
    propertyJson = fillBasicProperties(results, property);
    firstLoop = false;
    }
    // check if the property is different to the one
    // in the previous loop
    if (!propertyTemp.equals(property)) {
    if (!choices.isEmpty()) {
    System.out.println("UpdateObjectTypeServlet pASSO 5.1");
    choiceList.put("displayName", listDispName);
    choiceList.put("choices", choices);
    propertyJson.put("choiceList", choiceList);
    listDispName = results.getString("listdispname");
    choiceList = new JSONObject();
    choices = new JSONArray();
    }
    jsonPropertyData.add(propertyJson);
    property = propertyTemp;
    propertyJson = fillBasicProperties(results, property);
    }
    String listDispNameTemp = results.getString("listdispname");
    if (!results.wasNull()) {
    if (!listDispNameTemp.equals(listDispName)) {
    choiceList.put("displayName", listDispName);
    choiceList.put("choices", choices);
    propertyJson.put("choiceList", choiceList);
    // close property, add to array and create new
    jsonPropertyData.add(propertyJson);
    listDispName = listDispNameTemp;
    choiceList = new JSONObject();
    choices = new JSONArray();
    }
    } else {
    // no choice list attached, continue to next loop
    continue;
    }
    String dependentOnTemp = results.getString("depon");
    String dependentValueTemp = results.getString("depvalue");
    // check if there is a dependenOn/Value
    // set for the choice list
    if ((null != dependentOnTemp && null != dependentValueTemp
    && !dependentOnTemp.isEmpty() && !dependentValueTemp
    .isEmpty())) {
    // historic values are null, set dependentOn/dependentValue
    if (null == dependentOn && null == dependentValue) {
    dependentOn = dependentOnTemp;
    dependentValue = dependentValueTemp;
    propertyJson.put("dependentOn", dependentOn);
    propertyJson.put("dependentValue", dependentValue);
    } else {
    // historic values are not null but different,
    // start new dependent list
    if (!dependentOnTemp.equals(dependentOn)
    || !dependentValueTemp.equals(dependentValue)) {
    dependentOn = dependentOnTemp;
    dependentValue = dependentValueTemp;
    propertyJson = fillBasicProperties(results,
    property);
    propertyJson.put("dependentOn", dependentOn);
    propertyJson.put("dependentValue", dependentValue);
    }
    }
    }
    JSONObject choice = new JSONObject();
    choice.put("displayName", results.getString("dispname"));
    choice.put("value", results.getString("value"));
    choices.add(choice);
    }
    // add the last property

    choiceList.put("displayName", listDispName);
    choiceList.put("choices", choices);
    propertyJson.put("choiceList", choiceList);

    jsonPropertyData.add(propertyJson);
    stmt.close();
    con.close();
    } catch (NamingException e) {
    e.printStackTrace();
    } catch (SQLException se) {
    System.out.println("SQL Exception:");
    // Loop through the SQL Exceptions
    while (se != null) {
    System.out.println("State : " + se.getSQLState());
    System.out.println("Message: " + se.getMessage());
    System.out.println("Error : " + se.getErrorCode());
    se = se.getNextException();
    }
    } finally {
    try {
    if (null != con && !con.isClosed())
    con.close();
    } catch (SQLException se) {
    System.out.println("SQL Exception:");
    // Loop through the SQL Exceptions
    while (se != null) {
    System.out.println("State : " + se.getSQLState());
    System.out.println("Message: " + se.getMessage());
    System.out.println("Error : " + se.getErrorCode());
    se = se.getNextException();
    }
    }
    }

    return jsonPropertyData;
    }