public void dbReadList(Connection aconn)
   {
      synchronized(aconn)
      {
      try
      {
         String qstr = "";
           // if master table and field are defined, join the description table
         if (mastfld.length() > 0 && masttbl.length() > 0)
         {
            qstr = "Select a." + mastfld + ",a." + codefld + ",b." + descfld;
            if (!codefld.equals(sortfld))  qstr = qstr + ",b." + sortfld;
            qstr = qstr + " From " + masttbl + " a," + tablenm + " b";
            qstr = qstr + " Where a." + codefld + "=b." + codefld;
            qstr = qstr + " Order by a." + mastfld + ",b." + sortfld;
         }
         else
         {
            qstr = "Select " + codefld + "," + descfld;
            if (!codefld.equals(sortfld))  qstr = qstr + "," + sortfld;
            qstr = qstr + " From " + tablenm;
            qstr = qstr + " Order by " + sortfld;
         }
         
         Statement qstmt = aconn.createStatement();
         ResultSet rset = qstmt.executeQuery(qstr);

         while (rset.next())
         {
            CDescItem myitem = new CDescItem();
            if (mastfld.length() > 0 && masttbl.length() > 0)
            {
               myitem.mastval = rset.getString(1);
               myitem.codeval = rset.getString(2);
               myitem.descval = rset.getString(3);
            }
            else 
            {
               myitem.mastval = CAppConsts.TagNoValue;
               myitem.codeval = rset.getString(1);
               myitem.descval = rset.getString(2);
            }
            String mykey = myitem.mastval + "|" + myitem.codeval;
            this.addItem(mykey, myitem);
         }
         rset.close();
         qstmt.close();
      }
      catch (Exception ex)
      {
         CLogError.logError(CAppConsts.ErrorFile, false, "CCodeDesc.dbReadList " + tablenm + " ", ex);
      }
      }
   }