Problem with Retrieving Parent records

Hi
I am facing some problem with Relation ship tables
I am able to retrieve all child relation record by using Parent record id, but the other why around is not working that is
I am unable to retrieve  all parent records by using a child record.
Please can you help out this..
find the below sample method which i was trying
public HashMap<String, Record[]> getMemberRecords(Record[] rec,
               RetrieveRelationshipsCommand relation,
               RepositorySchemaEx repositorySchema, String code,
               HashMap<String, Record[]> returnMap) throws MDMException {
          LOG.debug("calling getMemberRecords");
          HashMap<String, Record[]> returnVal = returnMap;
          LOG.debug("Assigning returnType to default HashMap.");
          try {
               for (int recordCount = 0; recordCount < rec.length; recordCount++) {
                    LOG.debug("For recordCount = " + recordCount);
                    Record tempRec = rec[recordCount];
                    relation.setAnchorRecord(tempRec);
                    LOG.debug(" setting AnchorRecord = " + tempRec);
                    relation.setLoadRecords(true);
                    LOG.debug(" setting LoadRecords = " + true);
                    relation.setGetChildren(false);
                    LOG.debug(" setGetChildren has setup with  = " + true);
                    relation.setAnchorRecordId(tempRec.getId());
                    LOG.debug(" setting AnchorRecordId = " + tempRec.getId());
                    relation.setRelationshipId(repositorySchema
                              .getRelationshipId(code));
                    LOG.debug("Before execution relation execute.");
                    relation.execute();
                    LOG.debug("After execution relation execute.");
                    RelationshipGroup group = relation.getRelationshipGroup();
                    LOG.debug("Retrieved Relationship Group.");
                    Relationship[] relat = group.getMembers();
                    LOG.debug("Length = "+relat.length);
                    Record[] tempRecords = null;
                    if (relat != null) {
                         int length = relat.length;
                         LOG.debug("Length = "+length);
                         tempRecords = new Record[length];
                         for (int count = 0; count < length; count++) {
                              tempRecords[count] = relat[count].getMemberRecord();
                    if (tempRecords != null) {
                         LOG
                                   .info("Records size is not equal to Null So Calling recursive getMemberRecords.");
                         returnMap = getMemberRecords(tempRecords, relation,
                                   repositorySchema, code, returnMap);
                    LOG
                              .debug("Setting HashMap Value Values with Parent ID, records[]");
                    returnVal.put(tempRec.getId().getString(), tempRecords);
          } catch (SessionException se) {
               MDMException exception = new MDMException();
               ErrorContext ec = new ErrorContext();
               ec.setErrorMessage(se.getMessage());
               ec.setErrorCode("MetadataException : " + se);
               LOG.fatal(se, se.getCause());
               se.printStackTrace();
               exception.setContext(ec);
               throw exception;
          } catch (IllegalArgumentException iae) {
               MDMException exception = new MDMException();
               ErrorContext ec = new ErrorContext();
               ec.setErrorMessage(iae.getMessage());
               ec.setErrorCode("MetadataException : " + iae);
               LOG.fatal(iae, iae.getCause());
               iae.printStackTrace();
               exception.setContext(ec);
               throw exception;
          } catch (CommandException ce) {
               MDMException exception = new MDMException();
               ErrorContext ec = new ErrorContext();
               ec.setErrorMessage(ce.getMessage());
               LOG.fatal(ce, ce.getCause());
               ce.printStackTrace();
               exception.setContext(ec);
               throw exception;
          LOG.debug("Before returning from getMemberRecords");
          return returnVal;

Hi
I am facing some problem with Relation ship tables
I am able to retrieve all child relation record by using Parent record id, but the other why around is not working that is
I am unable to retrieve  all parent records by using a child record.
Please can you help out this..
find the below sample method which i was trying
public HashMap<String, Record[]> getMemberRecords(Record[] rec,
               RetrieveRelationshipsCommand relation,
               RepositorySchemaEx repositorySchema, String code,
               HashMap<String, Record[]> returnMap) throws MDMException {
          LOG.debug("calling getMemberRecords");
          HashMap<String, Record[]> returnVal = returnMap;
          LOG.debug("Assigning returnType to default HashMap.");
          try {
               for (int recordCount = 0; recordCount < rec.length; recordCount++) {
                    LOG.debug("For recordCount = " + recordCount);
                    Record tempRec = rec[recordCount];
                    relation.setAnchorRecord(tempRec);
                    LOG.debug(" setting AnchorRecord = " + tempRec);
                    relation.setLoadRecords(true);
                    LOG.debug(" setting LoadRecords = " + true);
                    relation.setGetChildren(false);
                    LOG.debug(" setGetChildren has setup with  = " + true);
                    relation.setAnchorRecordId(tempRec.getId());
                    LOG.debug(" setting AnchorRecordId = " + tempRec.getId());
                    relation.setRelationshipId(repositorySchema
                              .getRelationshipId(code));
                    LOG.debug("Before execution relation execute.");
                    relation.execute();
                    LOG.debug("After execution relation execute.");
                    RelationshipGroup group = relation.getRelationshipGroup();
                    LOG.debug("Retrieved Relationship Group.");
                    Relationship[] relat = group.getMembers();
                    LOG.debug("Length = "+relat.length);
                    Record[] tempRecords = null;
                    if (relat != null) {
                         int length = relat.length;
                         LOG.debug("Length = "+length);
                         tempRecords = new Record[length];
                         for (int count = 0; count < length; count++) {
                              tempRecords[count] = relat[count].getMemberRecord();
                    if (tempRecords != null) {
                         LOG
                                   .info("Records size is not equal to Null So Calling recursive getMemberRecords.");
                         returnMap = getMemberRecords(tempRecords, relation,
                                   repositorySchema, code, returnMap);
                    LOG
                              .debug("Setting HashMap Value Values with Parent ID, records[]");
                    returnVal.put(tempRec.getId().getString(), tempRecords);
          } catch (SessionException se) {
               MDMException exception = new MDMException();
               ErrorContext ec = new ErrorContext();
               ec.setErrorMessage(se.getMessage());
               ec.setErrorCode("MetadataException : " + se);
               LOG.fatal(se, se.getCause());
               se.printStackTrace();
               exception.setContext(ec);
               throw exception;
          } catch (IllegalArgumentException iae) {
               MDMException exception = new MDMException();
               ErrorContext ec = new ErrorContext();
               ec.setErrorMessage(iae.getMessage());
               ec.setErrorCode("MetadataException : " + iae);
               LOG.fatal(iae, iae.getCause());
               iae.printStackTrace();
               exception.setContext(ec);
               throw exception;
          } catch (CommandException ce) {
               MDMException exception = new MDMException();
               ErrorContext ec = new ErrorContext();
               ec.setErrorMessage(ce.getMessage());
               LOG.fatal(ce, ce.getCause());
               ce.printStackTrace();
               exception.setContext(ec);
               throw exception;
          LOG.debug("Before returning from getMemberRecords");
          return returnVal;

Similar Messages

  • Problems with retrieving data from tables with 240 and more records

    Hi,
    I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.
    I installed Oracle 11.2.0 Client and I started to have problems with retrieving data from tables.
    First I used the same connection string, driver and so on (O10 Oracle 10g) then I tried ORA Oracle but with no luck. The result is like this:
    I'm able to connect to database. I'm able to retrieve data but from small tables (e.g. with 110 records it works perfectly using both O10 and ORA drivers). When I try to retrieve data from tables with like 240 and more records retrieval simply hangs (nothing happens at all - no error, no timeout). Application seems to hang forever.
    I'm using Powerbuilder to connect to Database (either PB10.5 using O10 driver or PB12 using ORA driver). I used DBTrace, so I see that query hangs on the first FETCH.
    So for the retrievals that hang I have something like:
    (3260008): BIND SELECT OUTPUT BUFFER (DataWindow):(DBI_SELBIND) (0.186 MS / 18978.709 MS)
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=1
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
    (3260008): EXECUTE:(DBI_DW_EXECUTE) (192.982 MS / 19171.691 MS)
    (3260008): FETCH NEXT:(DBI_FETCHNEXT)
    and this is the last line,
    while for retrievals that end, I have FETCH producing time, data in buffer and moving to the next Fetch until all data is retrieved
    On the side note, I have no problems with retrieving data either by SQL Developer or DbVisualizer.
    Problems started when I installed 11.2.0 Client. Even if I want to use 10.0.1 Client, the same problem occurs. So I guess something from 11.2.0 overrides 10.0.1 settings.
    I will appreciate any comments/hints/help.
    Thank you very much.

    pgoel wrote:
    I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.Earlier (before installing new stuff) did you ever try retrieving data from big tables (like 240 and more records), if yes, was it working?Yes, with Oracle 10g client (before installing 11g) I was able to retrieve any data, either it was 10k+ records or 100 records. Installing 11g client changed something that even using old 10g client (which I still have installed) fails to work. The same problem occur no matter I'm using 10g or 11g client now. Powerbuilder hangs on retrieving tables with more than like 240 records.
    Thanks.

  • Problem with  Creating Info Record

    Hello Gurus,
    I've problem with Creating Info Record
    i tried to create info record for Plant Specific/Purchase Org
    The first Screen General Data is OK
    i entered all the data in the next screen ie
    Purchase Organization Data screen but i'm getting error
    <b>Make an entry in all required fields</b>
    but there is Mandatory Textbox ie "VALID TO" which im unable to select Bcos its Disabled
    pls help me regarding this
    thanks in advance

    Hi
    Have u given the net price. <b>VALID TO</b> is the date until which the price shown in the info record is valid.
    If there is no price that is valid on the current date, the last-valid price is displayed and the date field contains the day before the start of the next validity period (this may be 12.31.9999 if there is no further validity date). If all validit periods lie beyond the current date, the price of the next period is displayed. The date field then contains the end date of this period.
    These validity periods we will maintain Purchse data CONDITIONS while creating info record. Check the validity period for the conditions.
    Hope this will helps u
    Ravi
    Ravikumar Bolla

  • Problem with updating a record method in a database

    I've searched for the forums for info on this to no avail.
    I am connecting to Access database, using the sun.jdbc.odbc.JdbcOdbcDriver.
    I'm trying to be able to update 2 fields in a record (cost & quantity).
    I have an addrecord method, an update method.
    I can use the addrecord and it works great.
    But (yep, there's always a but!), when I try to update only the 1 or 2 fields on a record, I get a message that says "syntax error in UPDATE statement"
    I've written, deleted and re-written code & I'm going nuts.
    Here are my database methods and the actionPerformed where it calls those methods. Is the error message regarding my UPDATE (sql) syntax?
    Why does it work for adding, but not updating?? It seems my 1st if statement under my "update button" is never gone to... so maybe it's just a problem with my "if" statement.
    Please help me before I go crazy! Thanks!
    //flags
    //snippet of code
    private void enableButtons(boolean flag1)
        boolean flag2 = false;
        if (flag1 == false)
           flag2 = true;
        jbtUpdate.setEnabled(flag2); // was flag1 wouldn't work.
        jbtDelete.setEnabled(flag1);
        jbtAdd.setEnabled(flag1);
        jbtFirst.setEnabled(flag1);
        jbtNext.setEnabled(flag1);
        jbtPrev.setEnabled(flag1);
        jbtLast.setEnabled(flag1);
    //...actionperformed(ActionEvent e)
    else if (e.getSource() == jbtAdd)
        jtfItem.requestFocus();
        enableButtons(false);
        jtfItem.setText("");
        jtfDescription.setText("");
        jtfQuantity.setText("");
        jtfCost.setText("");
        addFlag = true;
      else if (e.getSource() == jbtUpdate)
        double quantity1 = parseInt(jtfQuantity.getText());
        double cost1  = parseCurrency(jtfCost.getText());
        Item itemUpdate = new Item(jtfItem.getText(), jtfDescription.getText(),
        cost1, (int)quantity1);
        System.out.println("update button was clicked");
        //first "if"
        if ((jbtUpdate.isEnabled()) && (addFlag == false))
          InventoryDB.updateField(itemUpdate);
          currentItem = itemUpdate;
          System.out.println("it's going to first if stmt");
        //2nd "if"
        if (addFlag == true)
          InventoryDB.addRecord(itemUpdate);
          currentItem = InventoryDB.moveFirst();
          addFlag = false;
          System.out.println("it's going to 2nd if stmt");
        currentItem = itemUpdate;
        performItemDisplay();
        enableButtons(true);
        System.out.println("it's going to last of update code");
    //method snippets  for database manipulation
    public static void addRecord(Item item) throws SQLException
        String query = "INSERT INTO Items (ItemNumber, ItemDescription, UnitCost, Quantity)  " +
            "VALUES ('" + item.getItem() + "', " +
               "'" +        item.getDescr() + "', " +
            "'" +         item.getCost() + "', " +
               "'" +     item.getQuantity() + "')";
        Statement statement = connection.createStatement();
        statement.executeUpdate(query);
        statement.close();
        close();
        open();
      public static void updateField(Item item) throws SQLException
        String query = "Update Items SET " +// Items (ItemNumber, ItemDescription, UnitCost, Quantity) " +
          "VALUES ('" + item.getCost() + "', " +
          "'" +     item.getQuantity() + "', " ;
    //      "WHERE ItemNumber  = " ItemNumber "'"
    //       "WHERE ItemDescription = " ItemDescription "', ";
          Statement statement = connection.createStatement();
          statement.executeUpdate(query);
          statement.close();
          close();
          open();
       public static void updateRecord(Item item) throws SQLException
        String query = "UPDATE Items SET " +
            "ItemNumber  = '" +      item.getItem() + "', " +
            "ItemDescription = '" + item.getDescr() + "', " +
               "UnitCost =  '" +        item.getCost() + "', " +
            "Quantity = '" +     item.getQuantity() + "', " +
            "WHERE ItemNumber = '" + item.getItem() +  "'";
        Statement statement = connection.createStatement();
        statement.executeUpdate(query);
        statement.close();
        close();
        open();
      public static void deleteRecord(String ItemNumber) throws SQLException
        String query = "DELETE FROM Items " +
            "WHERE ItemNumber = '" + ItemNumber + "'";
        Statement statement = connection.createStatement();
        statement.executeUpdate(query);
        statement.close();
        close();
        open();

    not familiar with this syntax,
    public static void updateField(Item item) throws
    s SQLException
    String query = "Update Items SET " +// Items
    ems (ItemNumber, ItemDescription, UnitCost, Quantity)
    " +
    "VALUES ('" + item.getCost() + "', " +
    "'" + item.getQuantity() + "', " ;
    // "WHERE ItemNumber = " ItemNumber "'"
    // "WHERE ItemDescription = " ItemDescription
    public static void updateRecord(Item item) throws
    ws SQLException
    String query = "UPDATE Items SET " +
    "ItemNumber = '" + item.getItem() + "', " +
    "ItemDescription = '" + item.getDescr() + "', " +
    "UnitCost = '" + item.getCost() +
    etCost() + "', " +
    "Quantity = '" + item.getQuantity() + "', " +one ',' too many
    "WHERE ItemNumber = '" + item.getItem() + "'";

  • JSF - Problem in Retrieving selected record from datatable

    I am new to JSF and in the process of developing a new web application using JSF.
    I have problem in retrieving the selected record from a datatable. I am using h:datatable tag and h:commandlink in a column for selecting a particular row on the datatable.
    I have populated the data to the datatable by binding a bean and its property.
    When I retrieve also I am binding to a bean in the action attribute of the h:commandlink tag in h:column of that datatable.But when I try to bind the bindign attribute of the h:datatable tag to the datatable instance in my Bean , my JSF File gets corrupted..
    How to implement this without any issue??plz help me regarding this.

    HI
    Try the below code
    DATA lo_nd_del TYPE REF TO if_wd_context_node.
    DATA lo_el_del TYPE REF TO if_wd_context_element.
    DATA ls_del TYPE wd_this->Element_del.
    DATA lo_nd_et_postab_1 TYPE REF TO if_wd_context_node.
    DATA lo_el_et_postab_1 TYPE REF TO if_wd_context_element.
    DATA ls_et_postab_1 TYPE wd_this->Element_del.
    DATA lt_et_postab_1 TYPE wd_this->Elements_del.
    DATA: wa_temp TYPE REF TO if_wd_context_element,
    lt_temp TYPE wdr_context_element_set.
    * navigate from <CONTEXT> to <ET_POSTAB_1> via lead selection
    lo_nd_et_postab_1 = wd_context->path_get_node( path = `ZSHP_EXTENDED_DUE_LI.CHANGING_3.ET_POSTAB_1` ).
    CALL METHOD lo_nd_et_postab_1->get_selected_elements
    RECEIVING
    set = lt_temp.
    * navigate from <CONTEXT> to <DEL> via lead selection
    lo_nd_et_postab_1 = wd_context->get_child_node( name = wd_this->wdctx_del ).
    LOOP AT lt_temp INTO wa_temp.
    CALL METHOD wa_temp->get_static_attributes
    IMPORTING
    static_attributes = ls_et_postab_1.
    ls_et_postab_1-vbeln = del. // adding new attribute value.
    APPEND ls_et_postab_1 TO lt_et_postab_1.
    CLEAR ls_et_postab_1.
    ENDLOOP.
    lo_nd_et_postab_1->bind_table( new_items = lt_et_postab_1 ).

  • Problem with retrieving Data

    I am reading the JBDC basic tutorial on Sun website.
    Yesterday, i had problems with connecting the driver and to the database.
    Now many folks on Sun forums help me to figure it out already.
    Now i wanna retrieve the data from the database i have created. But i got error.
    Exception in thread "main" java.sql.SQLSyntaxErrorException: Table/View 'COFFEES' does not exist.
         at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
         at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
         at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
         at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
         at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
         at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
         at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
         at org.apache.derby.impl.jdbc.EmbedStatement.executeQuery(Unknown Source)
         at HelloWorld.main(HelloWorld.java:36)
    Caused by: java.sql.SQLException: Table/View 'COFFEES' does not exist.
         at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
         at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
         ... 9 more
    Caused by: ERROR 42X05: Table/View 'COFFEES' does not exist.
         at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
         at org.apache.derby.impl.sql.compile.FromBaseTable.bindTableDescriptor(Unknown Source)
         at org.apache.derby.impl.sql.compile.FromBaseTable.bindNonVTITables(Unknown Source)
         at org.apache.derby.impl.sql.compile.FromList.bindTables(Unknown Source)
         at org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables(Unknown Source)
         at org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables(Unknown Source)
         at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(Unknown Source)
         at org.apache.derby.impl.sql.compile.CursorNode.bindStatement(Unknown Source)
         at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
         at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
         ... 3 moreI wonder whether we need a reference to the database we have created in our project( I am using eclipse).
    If so, how could we do that ?
    Please help me !!!
    Thanks in advance!!!!

    Here is my code. It's just something following what the tutorial on sun said:
    import java.sql.*;
    import org.apache.derby.client.am.SqlException;
    public class HelloWorld {
         private static Connection con;
          * @param args
          * @throws SQLException
         public static void main(String[] args) throws SQLException, SqlException{
              // TODO Auto-generated method stub
              String url = "jdbc:derby:COFFEEBREAK";
         try{
              Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
              System.out.println("Driver connected...");
         }catch(java.lang.ClassNotFoundException e){
              System.err.print("ClassNotFoundException : ");
              System.err.println(e.getMessage());
         try{
              con = DriverManager.getConnection(url);
              System.out.println("Database connected..");
         }catch(Exception e){
              System.err.print("Connection Error:");
              System.out.println(e.getMessage());
         // Retrieve the data from the database
         Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
         ResultSet srs = stmt.executeQuery("SELECT * FROM COFFEEBREAK.COFFEES");
         while (srs.next()){
              String name = srs.getString("COF_NAME");
              float price = srs.getFloat("PRICE");
              System.out.println(name+ "               "+ price);
    }PS: you could move this thread to the suitable category. I am sorry for asking through this ...

  • Problem with non-matching records

    I have 3 tables - TBL1 is a list of Conditions; TBL2 contains collected data; and TBL3 contains referenced details on the data in TBL2.
    TBL2 contains some matching values from TBL1.
    Ex.
    TBL1
    Condition
    01 Test A
    02 Test B
    03 Test C
    TBL2
    Name, Condition, Value
    Host101, 01 Test A, Yes
    Host101, 02 Test B, No
    Host101, 03 Test C, Yes
    Host102, 01 Test A, No
    Host102, 03 Test C, Yes
    I have them linked TBL1 Left Outer to TBL2 and TBL2 Left Outer to TBL3.
    My desire is to get the complete list of Conditions in TBL1 for each record in TBL2, even where there is no matching TBL1 value in TBL2 - so the report results of the above table data would be:
    Host101
    01 Test A     Yes
    02 Test B      No
    03 Test C      Yes
    Host102
    01 Test A     No
    02 Test B
    03 Test C      Yes
    So even though there is no data returned in TBL2 for Host102, 02 Test B, the record for that entry in TBL1 is still returned in the report.
    Currently I have the report structured as follows -
    {TBL2 Name}
    TBL1 Condition     TBL2 Value
    Seems quite simple, but I must be missing something somewhere, as I am only able to get the data where the records match, so, in the example above, I am getting only -
    Host102
    01 Test A     No
    03 Test C      Yes
    Any assistance would be much appreciated.  Thanks!
    Also, I tried doing a simple new report using just TBL1 & TBL2 and still get the same results (also tried a Full Outer join as well).
    Frustrating .......
    Edited by: Dragon77 on May 17, 2010 2:05 PM

    As I said, I have even tried removing TBL3 to make things even simpler - TBL1 & TBL2 Left Outer joined on the common field.
    I have tried every combination that I can think of.  We're talking on 4 fields in the report -
    Group Header 1 = {TBL2 Name}
    Group 2 = {TBL2 Unique Field}
    Detail = TBL1 Condition     TBL2 Value
    Group Header 1 = {TBL2 Name}
    Group 2 = {TBL2 Unique Field}
    Group 3 = {TBL1 Condition}     {TBL2 Value}
    Detail Suppressed
    No matter what I try, I only get matching records.
    I've gone so far as to just have the minimal 3 fields
    Group Header 1 = {TBL2 Name}
    Group 2 = {TBL2 Unique Field}
    Detail = TBL1 Condition
    Group Header 1 = {TBL2 Name}
    Group 2 = {TBL2 Unique Field}
    Group 3 = {TBL1 Condition}
    Detail Suppressed
    The tables only have the 1 field in comon {TBL1, TBL2 - Condition)
    This just doesn't make sense.  {TBL1 Condition} should have ALL of its entries returned along with any matching records from {TBL2 Condition} - not just where they are equal.

  • Problem with retrieving single digit date and month

    Hello Sir,
    I have the following code. Cuurently when I insert date in this format 1984/11/14 and also in this format 1984/11/4 and retrieve the following two dates, I could successfully populate the dates into the corresponding fields in the form. But earlier in the database, there are some records created in the following formats:
    1984/3/1 and 1987/10/4(i.e.,yyyy/mm/dd).In the form when I try to populate them into their corresponding fields I am able to populate only 1984 into the year filed in the first case and in the second case I could populate 1987 and 10 into the year and month fields. I could not populate the values of the records with single digit either in month or day fields.
    By observing the code, could you let me know what needs to be done in order to populate the previously created records with the single digit month and date.
    This is the jsp for creating and editing the records.
    <HTML>
    <HEAD>
         <TITLE> CRM Event Information </TITLE>
    <script language="JavaScript" src="../javascript/misc.js"></script>
    <script language="JavaScript">
    function saveMe(methodHow) {
         var elementNumber = CRMEvent.elements.length
         var field1 = "";
         var field2 = "";
         var field3 = "";
         var field4 = "";
         var field5 = "";
         var field6 = "";
         var field7 = "";
         var field8 = "";
         for(i=0; i < elementNumber; i++){
              submitForm.elements.name = CRMEvent.elements[i].name;
              submitForm.elements[i].value = CRMEvent.elements[i].value;
         for (k = 0; k < oneToMany1.addedItems.options.length; k++){;
              if (addTemp.field1oneToMany1Value[k] == ""){
              addTemp.field1oneToMany1Value[k] = "9999"
              if (addTemp.field2oneToMany1Value[k] == ""){
              addTemp.field2oneToMany1Value[k] = "99"
              if (addTemp.field3oneToMany1Value[k] == ""){
              addTemp.field3oneToMany1Value[k] = "99"
              if (addTemp.field4oneToMany1Value[k] == ""){
              addTemp.field4oneToMany1Value[k] = "9999"
              if (addTemp.field5oneToMany1Value[k] == ""){
              addTemp.field5oneToMany1Value[k] = " "
              if (addTemp.field6oneToMany1Value[k] == ""){
              addTemp.field6oneToMany1Value[k] = " "
              if (addTemp.field7oneToMany1Value[k] == ""){
              addTemp.field7oneToMany1Value[k] = " "
              if (addTemp.field8oneToMany1Value[k] == ""){
              addTemp.field8oneToMany1Value[k] = " "
              if (eval(oneToMany1.addedItems.options.length - 1) == k){
                   field1 = field1 + addTemp.field1oneToMany1Value[k];
                   field2 = field2 + addTemp.field2oneToMany1Value[k];
                   field3 = field3 + addTemp.field3oneToMany1Value[k];
                   field4 = field4 + addTemp.field4oneToMany1Value[k];
                   field5 = field5 + addTemp.field5oneToMany1Value[k];
                   field6 = field6 + addTemp.field6oneToMany1Value[k];
                   field7 = field7 + addTemp.field7oneToMany1Value[k];
                   field8 = field8 + addTemp.field8oneToMany1Value[k];
              }else{
                   field1 = field1 + addTemp.field1oneToMany1Value[k]+"|";
                   field2 = field2 + addTemp.field2oneToMany1Value[k]+"|";
                   field3 = field3 + addTemp.field3oneToMany1Value[k]+"|";
                   field4 = field4 + addTemp.field4oneToMany1Value[k]+"|";
                   field5 = field5 + addTemp.field5oneToMany1Value[k]+"|";
                   field6 = field6 + addTemp.field6oneToMany1Value[k]+"|";
                   field7 = field7 + addTemp.field7oneToMany1Value[k]+"|";
                   field8 = field8 + addTemp.field8oneToMany1Value[k]+"|";
              submitForm.elements[eval(i)].name      = "eventtype"
              submitForm.elements[eval(i)].value      = field1
              submitForm.elements[eval(i+1)].name      = "dd_crmstart"
              submitForm.elements[eval(i+1)].value      = field2
              submitForm.elements[eval(i+2)].name      = "mm_crmstart"
              submitForm.elements[eval(i+2)].value      = field3
              submitForm.elements[eval(i+3)].name      = "yy_crmstart"
              submitForm.elements[eval(i+3)].value      = field4
              submitForm.elements[eval(i+4)].name      = "crmremark_code"
              submitForm.elements[eval(i+4)].value      = field5
              submitForm.elements[eval(i+5)].name      = "crmperson_firstname"
              submitForm.elements[eval(i+5)].value      = field6
              submitForm.elements[eval(i+6)].name      = "crmperson_lastname"
              submitForm.elements[eval(i+6)].value      = field7
              submitForm.elements[eval(i+7)].name      = "crmnote"
              submitForm.elements[eval(i+7)].value      = field8
              submitForm.elements[eval(i+8)].name      = "mode"
              submitForm.elements[eval(i+8)].value      = methodHow
         submitForm.method="post";
         onSave(submitForm);
         function onSave(form) {
         if (!oneToMany1.addedItems.options.length == 0) {
              for (i=1;i<=oneToMany1.addedItems.options.length;i++) {
                   validate.elements[0].value = addTemp.field4oneToMany1Value[i-1];
                   if (validate.elements[0].value != '9999') {
                        if(!validateForm('validate','validation','isNumber')) {
                             alert("CRM Event Information "+ i + ": Year must be number");
                             return false;      
                        if(!validateForm('validate','validation','checkrange')) {
                             alert("CRM Event Information "+ i + ": Year out of range");
                             return false;      
              form.submit();
              return true;
    </script>
    </HEAD>
    <BODY BGCOLOR=#ffffff>
    <BASEFONT="3">
    <FONT SIZE = -1>
    <%@ page errorPage="errorPage.jsp" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="dss.*" %>
    <!-- instantiate -->
    <jsp:useBean id="pool" scope="session" class="dss.ConnectionPool" />
    <jsp:useBean id="SelectBox" scope="session" class="dss.dataMisc" />
    <jsp:useBean id="query" class="dss.QueryData" scope="session" />
    <%
    // *************check for user session *************
         session = request.getSession();
    if (session.getValue("userSession") == null) {
    response.sendRedirect (response.encodeRedirectUrl
    ("dssLogin.jsp?Origin=dssACCRMEventAddEdit.jsp"));
    else {
         String dhr_id = "";
    String mode = "";
    String eventtype = "9999";
    String crmremark_code = "";
    String crmperson = "";
    String crmnote = "";
    String crmKey = "";
         String dd_crmstart = "99";
         String mm_crmstart = "99";
    Vector tempVector = new Vector();
              Vector CRMEventVector = new Vector();
              Vector CRMEventPerson = new Vector();
              Vector monthVector = new Vector();
              Vector dayVector = new Vector();
              Vector field1Vector = new Vector();
              Vector field5Vector = new Vector();
              Vector field6Vector = new Vector();
              Vector field7Vector = new Vector();
              Vector field8Vector = new Vector();
              Vector field234Vector = new Vector();
              Vector tempDayVector = new Vector();
              Vector tempMonthVector = new Vector();
              Vector tempYearVector = new Vector();
              Connection conn = null ;
              conn = pool.getConnection() ;
              dss.Database db = new dss.Database( conn ) ;
              dhr_id = request.getParameter("dhr_id");
         try {
    mode = request.getParameter("mode");
    dhr_id = request.getParameter("dhr_id");
                   //look up Setting List
                   String strSQL = "";
                   //look up CRM Event Type List
                   strSQL ="select crmtype_code value, item display from code_crmtype order by 2" ;
                   db.setSQL( strSQL ) ;
                   db.query() ;
                   CRMEventVector = db.getSelectionList() ;
                   //look up Month List
                   db.setSQL( "select LPAD(to_char(month_code),2,'0') value , item display from code_month order by 1" ) ;
                   db.query() ;
                   monthVector = db.getSelectionList();
                   //look up Day List
                   db.setSQL( "select LPAD(to_char(day_code),2,'0') value , item display from code_day order by 1" ) ;
                   db.query() ;
                   dayVector = db.getSelectionList();
                   // ************ EDIT Mode *************
    if (mode.equals("edit"))
              //out.println("mode is edit");     
    mode = "edit";
         //***********get archaeology_pkey based on dhr_id
                        int archKey = 0;
                             strSQL = " SELECT archaeology_pkey "+
                                            " FROM archaeology "+
                                            " WHERE UPPER(dhr_id)='"+ dhr_id.toUpperCase() + "'";
                             //out.println(strSQL);
                             Statement stmt2 = conn.createStatement();
                             ResultSet rs2 = stmt2.executeQuery(strSQL);
                             while (rs2.next()) {
                                  archKey = rs2.getInt(1);
                             rs2.close();
                             stmt2.close();
                   // ********* end getting **************
              strSQL = "Select crmtype_code, crmstart, crmremark, crmperson_firstname, crmperson_lastname, crmnote "+
                   " From archaeologycrmevent " +
                   " Where archaeology_pkey =" + archKey ;
              Statement stmtSQL = conn.createStatement();
              ResultSet rset = stmtSQL.executeQuery(strSQL);
              ResultSetMetaData rsmd = rset.getMetaData() ;
                   while (rset.next()) {
                   //get values
                   field1Vector.addElement(rset.getString(1));
                   field234Vector.addElement(rset.getString(2));
                   field5Vector.addElement(rset.getString(3));
                   field6Vector.addElement(rset.getString(4));
                   field7Vector.addElement(rset.getString(5));
                   field8Vector.addElement(rset.getString(6));
                   //crmKey = rset.getString(7);
                   for (int i=0; i<field234Vector.size(); i++){
                        StringTokenizer tempDate = new StringTokenizer((String)field234Vector.elementAt(i),"/");                              
                        while (tempDate.hasMoreTokens() ) {
                             tempYearVector.addElement (     tempDate.nextToken());
                             tempMonthVector.addElement(     tempDate.nextToken());
                             tempDayVector.addElement (     tempDate.nextToken());
         } //end edit
         } //end try
         catch ( Exception e) {
              out.println ( e.toString() ) ;
         } finally {
              db.cleanup() ;
    %>
    <P>
    <FORM NAME="oneToMany1">
    <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 WIDTH="100%" BGCOLOR="#BBBBBB">
    <TR>
    <TD BGCOLOR="#002B82" COLSPAN=9 width="100%" height="31">
    <p align="center">
         <font face="Arial" size="2" color="#FFFFFF">
         <b>6. CRM Event Information - </b>DHR ID# : <%=dhr_id %>
         </font>
         </p>
         </td>
    </TR>
    <TR>
    <TD WIDTH=83 ALIGN="RIGHT" height="21"><FONT SIZE=-1><B>CRM Event Type: </FONT></B></TD>
    <TD WIDTH=112 height="21">
              <%
              out.println ( SelectBox.strSelectionList((Vector)CRMEventVector.elementAt(0), (Vector)CRMEventVector.elementAt(1), "field1", "", eventtype, "180" ));
              %>
    </TD>
    <TD WIDTH=89 ALIGN="RIGHT" height="21"><FONT SIZE=-1><B>Event Date: </FONT></B></TD>
    <TD WIDTH=455 height="21"><font size="1">
         <%
         out.println ("<b><font size = 1>Date: "+ SelectBox.strSelectionList((Vector)dayVector.elementAt(0), (Vector)dayVector.elementAt(1), "field2", "", dd_crmstart, "180" ));
         out.println ("Month: "+ SelectBox.strSelectionList((Vector)monthVector.elementAt(0), (Vector)monthVector.elementAt(1), "field3", "", mm_crmstart, "180" ));
         %>
    </select><B>Year:</B><input type="text" name="field4" size="4" id="Year" maxlength="4">
    </TD>
    </TR>
    <TR>
    <TD WIDTH=83 ALIGN="RIGHT" height="30"><FONT SIZE=-1><B>ID# Associated with Event:</B> </FONT></TD>
    <TD WIDTH=112 height="30">
              <input type="text" name="field5" size="15" value="<%=crmremark_code%>">
    </TD>
    <TD WIDTH=89 ALIGN="RIGHT" height="30"><FONT SIZE=-1><B>
              CRM Person/ Organization: </FONT></B></TD>
    <TD WIDTH=455 height="30">
         <% // Modified by Robert Cox 09/12/2001 - changed field size from 20 to 30 // %>     
         <TABLE BORDER="0">
              <TR><TD>
              <FONT SIZE="1"><B>First:</B></FONT><input type="text" name="field6" size="15">
              </TD>
              <TD>
         <FONT SIZE="1"><B>Last:</B></FONT><input type="text" name="field7" size="15">
              </TD>
              </TR>
         </TABLE>
    </TD>
    </TR>
    <TR>
    <TD WIDTH=83 ALIGN="RIGHT" height="79"><FONT SIZE=-1><B>CRM Event Comments: </FONT></B></TD>
    <TD COLSPAN="3" width="660" height="79">
         <TEXTAREA ROWS="5" NAME="field8" cols="65"></TEXTAREA>
         </TD>
    </TR>
    <TR>
    <TD COLSPAN="4">
         <table border="0" cellspacing="0" cellpadding="0" align="center">
         <tr>
         <td width="50" align="left"> </td>
         <td align="center">
              <input type="button" value="Add" onClick="addUpdate(1,8,oneToMany1,Array('field1','field2','field3','field4','field7','field6'))">
              <input type="button" value="Modify" onClick="addUpdate(2,8,oneToMany1,Array('field1','field2','field3','field4','field7','field6'))">
              <input type="button" value="Update" onClick="addUpdate(3,8,oneToMany1,Array('field1','field2','field3','field4','field7','field6'))">
              <input type="button" value="Remove" onClick="addUpdate(4,8,oneToMany1,Array('field1','field2','field3','field4','field7','field6'))">
         </td>
         <td width="50" align="right"> </td>
         </tr>
         </table>
    </TD>
    </TR>
    <tr>
    <td width="100%" align="center" height="40" colspan="4"><select size="3" name="addedItems" style="width:100%">
    </td>
    </tr>
    </TABLE>
    <%/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //|------------------------------------------------------------------------------------------------------------------------
    //| Start code for one-to-many in edit mode /
    //|---------------------------------------------
    %>
    <script language="javascript">
    /* Check to see if the necessary arrays have been defined - if not define them */
         try{
              if (!eval("addTemp.addoneToMany1Name")){
              //alert("False");
              addTemp.addoneToMany1Name = Array();
              addTemp.addoneToMany1Value = Array();
              for(i = 1; i <= 8; i++){
                   eval("addTemp.field" + i + "oneToMany1Value = Array();");
              }else{
              //alert("already created");
    /* Catch any errors that may occur when checking if arrays are defined */
         catch(e) {
              alert(e);
    <%
    Enumeration field1_      = field1Vector.elements();
    Enumeration field2_      = tempDayVector.elements();
    Enumeration field3_      = tempMonthVector.elements();
    Enumeration field4_      = tempYearVector.elements();
    Enumeration field5_      = field5Vector.elements();
    Enumeration field6_      = field6Vector.elements();
    Enumeration field7_      = field7Vector.elements();
    Enumeration field8_      = field8Vector.elements();
         Object currentfield1 = "";
         Object currentfield2 = "";
         Object currentfield3 = "";
         Object currentfield4 = "";
         Object currentfield5 = "";
         Object currentfield6 = "";
         Object currentfield7 = "";
         Object currentfield8 = "";
         int counter = 0;
         int clength = 1;
    while (field1_.hasMoreElements()){
    //out.println("while field1_ has more elements");
    //|---------------------------------------------------------------------------------------------------------------------------
    //| define field elements - Use first and second lines if text box or memo field, Use third line if select box /
    //|------------------------------------------------------------------------------------------------------------
    //     currentfield1 = query.replaceString(field1_.nextElement().toString(),"'","\'").trim();
    //     currentfield1 = query.replaceString(currentfield1.toString(),"\"","\\" + "\"");
         currentfield1 = field1_.nextElement();
    //     currentfield2 = query.replaceString(field2_.nextElement().toString(),"'","\'").trim();
    //     currentfield2 = query.replaceString(currentfield2.toString(),"\"","\\" + "\"");
         currentfield2 = field2_.nextElement();
    //     currentfield3 = query.replaceString(field3_.nextElement().toString(),"'","\'").trim();
    //     currentfield3 = query.replaceString(currentfield3.toString(),"\"","\\" + "\"");
         currentfield3 = field3_.nextElement();
         currentfield4 = query.replaceString(field4_.nextElement().toString(),"'","\'").trim();
         currentfield4 = query.replaceString(currentfield4.toString(),"\"","\\" + "\"");
    //     currentfield4 = field4_.nextElement();
         currentfield5 = query.replaceString(field5_.nextElement().toString(),"'","\'").trim();
         currentfield5 = query.replaceString(currentfield5.toString(),"\"","\\" + "\"");
    //     currentfield5 = tempElement;
         currentfield6 = query.replaceString(field6_.nextElement().toString(),"'","\'").trim();
         currentfield6 = query.replaceString(currentfield6.toString(),"\"","\\" + "\"");
    //     currentfield6 = field6_.nextElement();
         currentfield7 = query.replaceString(field7_.nextElement().toString(),"'","\'").trim();
         currentfield7 = query.replaceString(currentfield7.toString(),"\"","\\" + "\"");
    //     currentfield7 = field7_.nextElement();
         currentfield8 = query.replaceString(field8_.nextElement().toString(),"'","\'").trim();
         currentfield8 = query.replaceString(query.replaceString(query.replaceString(currentfield8.toString(),"\"","\\" + "\""),"\r","\\" + "r"),"\n","\\" + "n");
    //     currentfield8 = field8_.nextElement();
         out.println("oneToMany1.addedItems.options.length ="+clength+";");
    // First Line - Displayed fields, Second Line - Count value /
         out.println("oneToMany1.addedItems.options[" + counter + "].text = \"" + currentfield1 + " - " + currentfield2 + " - " + currentfield3 + " - " + currentfield4 + " - " + currentfield7 + " - " + currentfield6 + "\";");
         out.println("oneToMany1.addedItems.options[" + counter + "].value = '" + counter + "';");
    // First Line - Displayed fields, Second Line - Count value /
         out.println("addTemp.addoneToMany1Name[" + counter + "] = \"" + currentfield1 + " - " + currentfield2 + " - " + currentfield3 + " - " + currentfield4 + " - " + currentfield7 + " - " + currentfield6 + "\";");
         out.println("addTemp.addoneToMany1Value[" + counter + "] = \"" + counter + " \";");
    //           Use first line for text boxes and memo fields, Use second line for Select Boxes /
    //     out.println("addTemp.field1oneToMany1Value[" + counter + "] = \"" +      currentfield1 + "\";");
         out.println("addTemp.field1oneToMany1Value[" + counter + "] = '" +      currentfield1 + "';");
    //     out.println("addTemp.field2oneToMany1Value[" + counter + "] = \"" +      currentfield2 + "\";");
         out.println("addTemp.field2oneToMany1Value[" + counter + "] = '" +      currentfield2 + "';");
    //     out.println("addTemp.field3oneToMany1Value[" + counter + "] = \"" +      currentfield3 + " \";");
         out.println("addTemp.field3oneToMany1Value[" + counter + "] = '" +      currentfield3 + "';");
         out.println("addTemp.field4oneToMany1Value[" + counter + "] = \"" +      currentfield4 + "\";");
    //     out.println("addTemp.field4oneToMany1Value[" + counter + "] = '" +      currentfield4 + "';");
         out.println("addTemp.field5oneToMany1Value[" + counter + "] = \"" +      currentfield5 + "\";");
    //     out.println("addTemp.field5oneToMany1Value[" + counter + "] = '" +      currentfield5 + "';");
         out.println("addTemp.field6oneToMany1Value[" + counter + "] = \"" +      currentfield6 + "\";");
    //     out.println("addTemp.field6oneToMany1Value[" + counter + "] = '" +      currentfield6 + "';");
         out.println("addTemp.field7oneToMany1Value[" + counter + "] = \"" +      currentfield7 + "\";");
    //     out.println("addTemp.field7oneToMany1Value[" + counter + "] = '" +      currentfield7 + "';");
         out.println("addTemp.field8oneToMany1Value[" + counter + "] = \"" +      currentfield8 + "\";");
    //     out.println("addTemp.field8oneToMany1Value[" + counter + "] = '" +      currentfield8 + "';");
         clength = clength + 1;
         counter = counter + 1;
    %>
    </script>
    </FORM>
    </FONT>
    <BR>
    <FORM NAME="CRMEvent">
    <input type="hidden" name=dhr_id value=<%=dhr_id %>>
    <!-- <input type="hidden" name=crmKey value=<%//=crmKey %>> -->
    <input type="hidden" name=mode value=<%=mode%>>
    <table border="0" width="100%" cellspacing="1">
    <tr>
         <%
              if (mode.equals("add")) {
              %>
    <td width="67"><input type="button" value="Next >>" name="Next" onClick="callNext(this.form, '<%=dhr_id%>', 'dssMenuChoice.jsp?item=2,1,1,7', '<%=mode%>')" ></td>
    <td width="120"></td>
    <td width="52"><input type="button" value="Save" name="Save" onClick="saveMe('add')"></td>
         <% } else if (mode.equals("edit")){
         %>
    <td width="103"><input type="button" value="<< Previous" name="Previous" onclick="history.go(-1)"></td>
    <td width="67"><input type="button" value="Next >>" name="Next" onClick="callNext(this.form, '<%=dhr_id%>', 'dssMenuChoice.jsp?item=2,1,1,7', '<%=mode%>')" ></td>
    <td width="120"></td>
         <td width="52"><input type="button" value="Save" name="Save" onClick="saveMe('edit')"></td>
         <%
         %>
    </tr>
    </table>
    <%
    }; //end else for checking session
    %>
    </FORM>
    <HR>
    Click the next button to move to the next screen without saving the current screen.<br>
    Click the save button to save the current screen and then move to the next screen.<br>
    <p>
    <form name="submitForm" action="dssACCRMEventDB.jsp" action="post">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    </form>
    <form name="validate">
    <input type="hidden" name="validation">
    </form>
    </BODY>
    </HTML>

    Hello Sir,
    I have the following code. Cuurently when I insert date in this format 1984/11/14 and also in this format 1984/11/4 and retrieve the following two dates, I could successfully populate the dates into the corresponding fields in the form. But earlier in the database, there are some records created in the following formats:
    1984/3/1 and 1987/10/4(i.e.,yyyy/mm/dd).In the form when I try to populate them into their corresponding fields I am able to populate only 1984 into the year filed in the first case and in the second case I could populate 1987 and 10 into the year and month fields. I could not populate the values of the records with single digit either in month or day fields.
    By observing the code, could you let me know what needs to be done in order to populate the previously created records with the single digit month and date.
    This is the jsp for creating and editing the records.
    <HTML>
    <HEAD>
         <TITLE> CRM Event Information </TITLE>
    <script language="JavaScript" src="../javascript/misc.js"></script>
    <script language="JavaScript">
    function saveMe(methodHow) {
         var elementNumber = CRMEvent.elements.length
         var field1 = "";
         var field2 = "";
         var field3 = "";
         var field4 = "";
         var field5 = "";
         var field6 = "";
         var field7 = "";
         var field8 = "";
         for(i=0; i < elementNumber; i++){
              submitForm.elements.name = CRMEvent.elements[i].name;
              submitForm.elements[i].value = CRMEvent.elements[i].value;
         for (k = 0; k < oneToMany1.addedItems.options.length; k++){;
              if (addTemp.field1oneToMany1Value[k] == ""){
              addTemp.field1oneToMany1Value[k] = "9999"
              if (addTemp.field2oneToMany1Value[k] == ""){
              addTemp.field2oneToMany1Value[k] = "99"
              if (addTemp.field3oneToMany1Value[k] == ""){
              addTemp.field3oneToMany1Value[k] = "99"
              if (addTemp.field4oneToMany1Value[k] == ""){
              addTemp.field4oneToMany1Value[k] = "9999"
              if (addTemp.field5oneToMany1Value[k] == ""){
              addTemp.field5oneToMany1Value[k] = " "
              if (addTemp.field6oneToMany1Value[k] == ""){
              addTemp.field6oneToMany1Value[k] = " "
              if (addTemp.field7oneToMany1Value[k] == ""){
              addTemp.field7oneToMany1Value[k] = " "
              if (addTemp.field8oneToMany1Value[k] == ""){
              addTemp.field8oneToMany1Value[k] = " "
              if (eval(oneToMany1.addedItems.options.length - 1) == k){
                   field1 = field1 + addTemp.field1oneToMany1Value[k];
                   field2 = field2 + addTemp.field2oneToMany1Value[k];
                   field3 = field3 + addTemp.field3oneToMany1Value[k];
                   field4 = field4 + addTemp.field4oneToMany1Value[k];
                   field5 = field5 + addTemp.field5oneToMany1Value[k];
                   field6 = field6 + addTemp.field6oneToMany1Value[k];
                   field7 = field7 + addTemp.field7oneToMany1Value[k];
                   field8 = field8 + addTemp.field8oneToMany1Value[k];
              }else{
                   field1 = field1 + addTemp.field1oneToMany1Value[k]+"|";
                   field2 = field2 + addTemp.field2oneToMany1Value[k]+"|";
                   field3 = field3 + addTemp.field3oneToMany1Value[k]+"|";
                   field4 = field4 + addTemp.field4oneToMany1Value[k]+"|";
                   field5 = field5 + addTemp.field5oneToMany1Value[k]+"|";
                   field6 = field6 + addTemp.field6oneToMany1Value[k]+"|";
                   field7 = field7 + addTemp.field7oneToMany1Value[k]+"|";
                   field8 = field8 + addTemp.field8oneToMany1Value[k]+"|";
              submitForm.elements[eval(i)].name      = "eventtype"
              submitForm.elements[eval(i)].value      = field1
              submitForm.elements[eval(i+1)].name      = "dd_crmstart"
              submitForm.elements[eval(i+1)].value      = field2
              submitForm.elements[eval(i+2)].name      = "mm_crmstart"
              submitForm.elements[eval(i+2)].value      = field3
              submitForm.elements[eval(i+3)].name      = "yy_crmstart"
              submitForm.elements[eval(i+3)].value      = field4
              submitForm.elements[eval(i+4)].name      = "crmremark_code"
              submitForm.elements[eval(i+4)].value      = field5
              submitForm.elements[eval(i+5)].name      = "crmperson_firstname"
              submitForm.elements[eval(i+5)].value      = field6
              submitForm.elements[eval(i+6)].name      = "crmperson_lastname"
              submitForm.elements[eval(i+6)].value      = field7
              submitForm.elements[eval(i+7)].name      = "crmnote"
              submitForm.elements[eval(i+7)].value      = field8
              submitForm.elements[eval(i+8)].name      = "mode"
              submitForm.elements[eval(i+8)].value      = methodHow
         submitForm.method="post";
         onSave(submitForm);
         function onSave(form) {
         if (!oneToMany1.addedItems.options.length == 0) {
              for (i=1;i<=oneToMany1.addedItems.options.length;i++) {
                   validate.elements[0].value = addTemp.field4oneToMany1Value[i-1];
                   if (validate.elements[0].value != '9999') {
                        if(!validateForm('validate','validation','isNumber')) {
                             alert("CRM Event Information "+ i + ": Year must be number");
                             return false;      
                        if(!validateForm('validate','validation','checkrange')) {
                             alert("CRM Event Information "+ i + ": Year out of range");
                             return false;      
              form.submit();
              return true;
    </script>
    </HEAD>
    <BODY BGCOLOR=#ffffff>
    <BASEFONT="3">
    <FONT SIZE = -1>
    <%@ page errorPage="errorPage.jsp" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="dss.*" %>
    <!-- instantiate -->
    <jsp:useBean id="pool" scope="session" class="dss.ConnectionPool" />
    <jsp:useBean id="SelectBox" scope="session" class="dss.dataMisc" />
    <jsp:useBean id="query" class="dss.QueryData" scope="session" />
    <%
    // *************check for user session *************
         session = request.getSession();
    if (session.getValue("userSession") == null) {
    response.sendRedirect (response.encodeRedirectUrl
    ("dssLogin.jsp?Origin=dssACCRMEventAddEdit.jsp"));
    else {
         String dhr_id = "";
    String mode = "";
    String eventtype = "9999";
    String crmremark_code = "";
    String crmperson = "";
    String crmnote = "";
    String crmKey = "";
         String dd_crmstart = "99";
         String mm_crmstart = "99";
    Vector tempVector = new Vector();
              Vector CRMEventVector = new Vector();
              Vector CRMEventPerson = new Vector();
              Vector monthVector = new Vector();
              Vector dayVector = new Vector();
              Vector field1Vector = new Vector();
              Vector field5Vector = new Vector();
              Vector field6Vector = new Vector();
              Vector field7Vector = new Vector();
              Vector field8Vector = new Vector();
              Vector field234Vector = new Vector();
              Vector tempDayVector = new Vector();
              Vector tempMonthVector = new Vector();
              Vector tempYearVector = new Vector();
              Connection conn = null ;
              conn = pool.getConnection() ;
              dss.Database db = new dss.Database( conn ) ;
              dhr_id = request.getParameter("dhr_id");
         try {
    mode = request.getParameter("mode");
    dhr_id = request.getParameter("dhr_id");
                   //look up Setting List
                   String strSQL = "";
                   //look up CRM Event Type List
                   strSQL ="select crmtype_code value, item display from code_crmtype order by 2" ;
                   db.setSQL( strSQL ) ;
                   db.query() ;
                   CRMEventVector = db.getSelectionList() ;
                   //look up Month List
                   db.setSQL( "select LPAD(to_char(month_code),2,'0') value , item display from code_month order by 1" ) ;
                   db.query() ;
                   monthVector = db.getSelectionList();
                   //look up Day List
                   db.setSQL( "select LPAD(to_char(day_code),2,'0') value , item display from code_day order by 1" ) ;
                   db.query() ;
                   dayVector = db.getSelectionList();
                   // ************ EDIT Mode *************
    if (mode.equals("edit"))
              //out.println("mode is edit");     
    mode = "edit";
         //***********get archaeology_pkey based on dhr_id
                        int archKey = 0;
                             strSQL = " SELECT archaeology_pkey "+
                                            " FROM archaeology "+
                                            " WHERE UPPER(dhr_id)='"+ dhr_id.toUpperCase() + "'";
                             //out.println(strSQL);
                             Statement stmt2 = conn.createStatement();
                             ResultSet rs2 = stmt2.executeQuery(strSQL);
                             while (rs2.next()) {
                                  archKey = rs2.getInt(1);
                             rs2.close();
                             stmt2.close();
                   // ********* end getting **************
              strSQL = "Select crmtype_code, crmstart, crmremark, crmperson_firstname, crmperson_lastname, crmnote "+
                   " From archaeologycrmevent " +
                   " Where archaeology_pkey =" + archKey ;
              Statement stmtSQL = conn.createStatement();
              ResultSet rset = stmtSQL.executeQuery(strSQL);
              ResultSetMetaData rsmd = rset.getMetaData() ;
                   while (rset.next()) {
                   //get values
                   field1Vector.addElement(rset.getString(1));
                   field234Vector.addElement(rset.getString(2));
                   field5Vector.addElement(rset.getString(3));
                   field6Vector.addElement(rset.getString(4));
                   field7Vector.addElement(rset.getString(5));
                   field8Vector.addElement(rset.getString(6));
                   //crmKey = rset.getString(7);
                   for (int i=0; i<field234Vector.size(); i++){
                        StringTokenizer tempDate = new StringTokenizer((String)field234Vector.elementAt(i),"/");                              
                        while (tempDate.hasMoreTokens() ) {
                             tempYearVector.addElement (     tempDate.nextToken());
                             tempMonthVector.addElement(     tempDate.nextToken());
                             tempDayVector.addElement (     tempDate.nextToken());
         } //end edit
         } //end try
         catch ( Exception e) {
              out.println ( e.toString() ) ;
         } finally {
              db.cleanup() ;
    %>
    <P>
    <FORM NAME="oneToMany1">
    <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 WIDTH="100%" BGCOLOR="#BBBBBB">
    <TR>
    <TD BGCOLOR="#002B82" COLSPAN=9 width="100%" height="31">
    <p align="center">
         <font face="Arial" size="2" color="#FFFFFF">
         <b>6. CRM Event Information - </b>DHR ID# : <%=dhr_id %>
         </font>
         </p>
         </td>
    </TR>
    <TR>
    <TD WIDTH=83 ALIGN="RIGHT" height="21"><FONT SIZE=-1><B>CRM Event Type: </FONT></B></TD>
    <TD WIDTH=112 height="21">
              <%
              out.println ( SelectBox.strSelectionList((Vector)CRMEventVector.elementAt(0), (Vector)CRMEventVector.elementAt(1), "field1", "", eventtype, "180" ));
              %>
    </TD>
    <TD WIDTH=89 ALIGN="RIGHT" height="21"><FONT SIZE=-1><B>Event Date: </FONT></B></TD>
    <TD WIDTH=455 height="21"><font size="1">
         <%
         out.println ("<b><font size = 1>Date: "+ SelectBox.strSelectionList((Vector)dayVector.elementAt(0), (Vector)dayVector.elementAt(1), "field2", "", dd_crmstart, "180" ));
         out.println ("Month: "+ SelectBox.strSelectionList((Vector)monthVector.elementAt(0), (Vector)monthVector.elementAt(1), "field3", "", mm_crmstart, "180" ));
         %>
    </select><B>Year:</B><input type="text" name="field4" size="4" id="Year" maxlength="4">
    </TD>
    </TR>
    <TR>
    <TD WIDTH=83 ALIGN="RIGHT" height="30"><FONT SIZE=-1><B>ID# Associated with Event:</B> </FONT></TD>
    <TD WIDTH=112 height="30">
              <input type="text" name="field5" size="15" value="<%=crmremark_code%>">
    </TD>
    <TD WIDTH=89 ALIGN="RIGHT" height="30"><FONT SIZE=-1><B>
              CRM Person/ Organization: </FONT></B></TD>
    <TD WIDTH=455 height="30">
         <% // Modified by Robert Cox 09/12/2001 - changed field size from 20 to 30 // %>     
         <TABLE BORDER="0">
              <TR><TD>
              <FONT SIZE="1"><B>First:</B></FONT><input type="text" name="field6" size="15">
              </TD>
              <TD>
         <FONT SIZE="1"><B>Last:</B></FONT><input type="text" name="field7" size="15">
              </TD>
              </TR>
         </TABLE>
    </TD>
    </TR>
    <TR>
    <TD WIDTH=83 ALIGN="RIGHT" height="79"><FONT SIZE=-1><B>CRM Event Comments: </FONT></B></TD>
    <TD COLSPAN="3" width="660" height="79">
         <TEXTAREA ROWS="5" NAME="field8" cols="65"></TEXTAREA>
         </TD>
    </TR>
    <TR>
    <TD COLSPAN="4">
         <table border="0" cellspacing="0" cellpadding="0" align="center">
         <tr>
         <td width="50" align="left"> </td>
         <td align="center">
              <input type="button" value="Add" onClick="addUpdate(1,8,oneToMany1,Array('field1','field2','field3','field4','field7','field6'))">
              <input type="button" value="Modify" onClick="addUpdate(2,8,oneToMany1,Array('field1','field2','field3','field4','field7','field6'))">
              <input type="button" value="Update" onClick="addUpdate(3,8,oneToMany1,Array('field1','field2','field3','field4','field7','field6'))">
              <input type="button" value="Remove" onClick="addUpdate(4,8,oneToMany1,Array('field1','field2','field3','field4','field7','field6'))">
         </td>
         <td width="50" align="right"> </td>
         </tr>
         </table>
    </TD>
    </TR>
    <tr>
    <td width="100%" align="center" height="40" colspan="4"><select size="3" name="addedItems" style="width:100%">
    </td>
    </tr>
    </TABLE>
    <%/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //|------------------------------------------------------------------------------------------------------------------------
    //| Start code for one-to-many in edit mode /
    //|---------------------------------------------
    %>
    <script language="javascript">
    /* Check to see if the necessary arrays have been defined - if not define them */
         try{
              if (!eval("addTemp.addoneToMany1Name")){
              //alert("False");
              addTemp.addoneToMany1Name = Array();
              addTemp.addoneToMany1Value = Array();
              for(i = 1; i <= 8; i++){
                   eval("addTemp.field" + i + "oneToMany1Value = Array();");
              }else{
              //alert("already created");
    /* Catch any errors that may occur when checking if arrays are defined */
         catch(e) {
              alert(e);
    <%
    Enumeration field1_      = field1Vector.elements();
    Enumeration field2_      = tempDayVector.elements();
    Enumeration field3_      = tempMonthVector.elements();
    Enumeration field4_      = tempYearVector.elements();
    Enumeration field5_      = field5Vector.elements();
    Enumeration field6_      = field6Vector.elements();
    Enumeration field7_      = field7Vector.elements();
    Enumeration field8_      = field8Vector.elements();
         Object currentfield1 = "";
         Object currentfield2 = "";
         Object currentfield3 = "";
         Object currentfield4 = "";
         Object currentfield5 = "";
         Object currentfield6 = "";
         Object currentfield7 = "";
         Object currentfield8 = "";
         int counter = 0;
         int clength = 1;
    while (field1_.hasMoreElements()){
    //out.println("while field1_ has more elements");
    //|---------------------------------------------------------------------------------------------------------------------------
    //| define field elements - Use first and second lines if text box or memo field, Use third line if select box /
    //|------------------------------------------------------------------------------------------------------------
    //     currentfield1 = query.replaceString(field1_.nextElement().toString(),"'","\'").trim();
    //     currentfield1 = query.replaceString(currentfield1.toString(),"\"","\\" + "\"");
         currentfield1 = field1_.nextElement();
    //     currentfield2 = query.replaceString(field2_.nextElement().toString(),"'","\'").trim();
    //     currentfield2 = query.replaceString(currentfield2.toString(),"\"","\\" + "\"");
         currentfield2 = field2_.nextElement();
    //     currentfield3 = query.replaceString(field3_.nextElement().toString(),"'","\'").trim();
    //     currentfield3 = query.replaceString(currentfield3.toString(),"\"","\\" + "\"");
         currentfield3 = field3_.nextElement();
         currentfield4 = query.replaceString(field4_.nextElement().toString(),"'","\'").trim();
         currentfield4 = query.replaceString(currentfield4.toString(),"\"","\\" + "\"");
    //     currentfield4 = field4_.nextElement();
         currentfield5 = query.replaceString(field5_.nextElement().toString(),"'","\'").trim();
         currentfield5 = query.replaceString(currentfield5.toString(),"\"","\\" + "\"");
    //     currentfield5 = tempElement;
         currentfield6 = query.replaceString(field6_.nextElement().toString(),"'","\'").trim();
         currentfield6 = query.replaceString(currentfield6.toString(),"\"","\\" + "\"");
    //     currentfield6 = field6_.nextElement();
         currentfield7 = query.replaceString(field7_.nextElement().toString(),"'","\'").trim();
         currentfield7 = query.replaceString(currentfield7.toString(),"\"","\\" + "\"");
    //     currentfield7 = field7_.nextElement();
         currentfield8 = query.replaceString(field8_.nextElement().toString(),"'","\'").trim();
         currentfield8 = query.replaceString(query.replaceString(query.replaceString(currentfield8.toString(),"\"","\\" + "\""),"\r","\\" + "r"),"\n","\\" + "n");
    //     currentfield8 = field8_.nextElement();
         out.println("oneToMany1.addedItems.options.length ="+clength+";");
    // First Line - Displayed fields, Second Line - Count value /
         out.println("oneToMany1.addedItems.options[" + counter + "].text = \"" + currentfield1 + " - " + currentfield2 + " - " + currentfield3 + " - " + currentfield4 + " - " + currentfield7 + " - " + currentfield6 + "\";");
         out.println("oneToMany1.addedItems.options[" + counter + "].value = '" + counter + "';");
    // First Line - Displayed fields, Second Line - Count value /
         out.println("addTemp.addoneToMany1Name[" + counter + "] = \"" + currentfield1 + " - " + currentfield2 + " - " + currentfield3 + " - " + currentfield4 + " - " + currentfield7 + " - " + currentfield6 + "\";");
         out.println("addTemp.addoneToMany1Value[" + counter + "] = \"" + counter + " \";");
    //           Use first line for text boxes and memo fields, Use second line for Select Boxes /
    //     out.println("addTemp.field1oneToMany1Value[" + counter + "] = \"" +      currentfield1 + "\";");
         out.println("addTemp.field1oneToMany1Value[" + counter + "] = '" +      currentfield1 + "';");
    //     out.println("addTemp.field2oneToMany1Value[" + counter + "] = \"" +      currentfield2 + "\";");
         out.println("addTemp.field2oneToMany1Value[" + counter + "] = '" +      currentfield2 + "';");
    //     out.println("addTemp.field3oneToMany1Value[" + counter + "] = \"" +      currentfield3 + " \";");
         out.println("addTemp.field3oneToMany1Value[" + counter + "] = '" +      currentfield3 + "';");
         out.println("addTemp.field4oneToMany1Value[" + counter + "] = \"" +      currentfield4 + "\";");
    //     out.println("addTemp.field4oneToMany1Value[" + counter + "] = '" +      currentfield4 + "';");
         out.println("addTemp.field5oneToMany1Value[" + counter + "] = \"" +      currentfield5 + "\";");
    //     out.println("addTemp.field5oneToMany1Value[" + counter + "] = '" +      currentfield5 + "';");
         out.println("addTemp.field6oneToMany1Value[" + counter + "] = \"" +      currentfield6 + "\";");
    //     out.println("addTemp.field6oneToMany1Value[" + counter + "] = '" +      currentfield6 + "';");
         out.println("addTemp.field7oneToMany1Value[" + counter + "] = \"" +      currentfield7 + "\";");
    //     out.println("addTemp.field7oneToMany1Value[" + counter + "] = '" +      currentfield7 + "';");
         out.println("addTemp.field8oneToMany1Value[" + counter + "] = \"" +      currentfield8 + "\";");
    //     out.println("addTemp.field8oneToMany1Value[" + counter + "] = '" +      currentfield8 + "';");
         clength = clength + 1;
         counter = counter + 1;
    %>
    </script>
    </FORM>
    </FONT>
    <BR>
    <FORM NAME="CRMEvent">
    <input type="hidden" name=dhr_id value=<%=dhr_id %>>
    <!-- <input type="hidden" name=crmKey value=<%//=crmKey %>> -->
    <input type="hidden" name=mode value=<%=mode%>>
    <table border="0" width="100%" cellspacing="1">
    <tr>
         <%
              if (mode.equals("add")) {
              %>
    <td width="67"><input type="button" value="Next >>" name="Next" onClick="callNext(this.form, '<%=dhr_id%>', 'dssMenuChoice.jsp?item=2,1,1,7', '<%=mode%>')" ></td>
    <td width="120"></td>
    <td width="52"><input type="button" value="Save" name="Save" onClick="saveMe('add')"></td>
         <% } else if (mode.equals("edit")){
         %>
    <td width="103"><input type="button" value="<< Previous" name="Previous" onclick="history.go(-1)"></td>
    <td width="67"><input type="button" value="Next >>" name="Next" onClick="callNext(this.form, '<%=dhr_id%>', 'dssMenuChoice.jsp?item=2,1,1,7', '<%=mode%>')" ></td>
    <td width="120"></td>
         <td width="52"><input type="button" value="Save" name="Save" onClick="saveMe('edit')"></td>
         <%
         %>
    </tr>
    </table>
    <%
    }; //end else for checking session
    %>
    </FORM>
    <HR>
    Click the next button to move to the next screen without saving the current screen.<br>
    Click the save button to save the current screen and then move to the next screen.<br>
    <p>
    <form name="submitForm" action="dssACCRMEventDB.jsp" action="post">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    <input type="hidden" name="temporary"><input type="hidden" name="temporary"><input type="hidden" name="temporary">
    </form>
    <form name="validate">
    <input type="hidden" name="validation">
    </form>
    </BODY>
    </HTML>

  • Problem with Retrieving objects and using info...

    Ok heres my problem.
    I have implemented a Queue using a linkedlist in java. Ok then i created a new object(in its own class - called Data) with two values, amount and price. I want the queue to store these two values in one Node. So i pass the values to it like this:
    Data A = new Data();
    A.price = Intger.parseInt(jTextField.getText());
    A.amount = Integer.ParseInt(jTextField.getText());
    Now I pass the Queue like this
    Queue B = new Queue ();
    B.enqueue(A);
    Which seems to work fine, the problem is that I need to work with the numbers in the Queue, update them, put them back and retrieve them.
    So I create a new Data object and try to dequeue like this:
    Data C = new Data();
    C = B.dequeue(); //So i can work with the two values
    but this doest work. It gives me the error that it needs an object.
    Am I doing it right?
    Anyone got any better ideas on how to do this? - Passing and retrieving two values to one Node.
    Plz help, im a newbie in Java, and cant find any tutorials on the internet.

    why don't you use vector.
    Vector queue = new Vector();
    Data a = new Data();
    a.price = Intger.parseInt(jTextField.getText());
    a.amount = Integer.ParseInt(jTextField.getText());
    queue.addElement(a);
    Data c = new Data();
    c.price = Intger.parseInt(jTextField.getText());
    c.amount = Integer.ParseInt(jTextField.getText());
    queue.addElement(c);

  • Problem with retrieve - wrong outline structure?

    Hi all,
    I use essbase 11.1.2.
    I have a Cube with a dimension "Employee" (10000 member) and a dimension "CostCenter" (1700 member).
    They all have a measure value of 1.
    When i make a drill down on Employee i get a list of 10 k entries. When i do an additional drill down on cost center i get essbase error message 1020051: Limit of 250000 used rows is passed. I can't understand why. i have supress zero rows and columns on.
    and every customer only has a value in only one cost center (1:1). --> it should be still 10 k rows after the second drill down.
    Why does essbase mean it needs more than 250000 rows?
    I hope someone can help
    thank you ,
    best regards
    Bernd

    Hi Bernd,
    This is a known problem. See My Oracle Support ID 591649.1.
    I ran into the same issue last week. Here is the note from Oracle My Support:
    Symptoms
    When drilling down on a dimension with a lot of members, receiving the error "1020051 Maximum number of rows processed [250000] exceeded [251836]".
    Cause
    When users zoom in on one or more members, Essbase must process a larger grid containing selected members expanded to the zoom-in level set in the options.  By default, the number of rows Essbase can process is 250000.
    Solution
    This limitation has been removed in the EPM v11.1.2.1.102 release.  The maximum number of spreadsheet rows Essbase processes on a request can now be set to 16,384 or higher. For example, to increase the number of rows to one million, add the following to the $ARBORPATH/essbase.cfg file:
    SSPROCROWLIMIT 1000000
    It is not recommended to use a limit higher than 500,000.  A higher setting increases the memory utilization and will increase query times.
    For versions prior to v11.1.2.1.102:
    Increase the number of rows Essbase can process.  Add the following line to the essbase.cfg file:
    SSPROCROWLIMIT 500000
    The maximum that this can be set to is 500000.
    Note:
    SSPROCROWLIMIT applies to unprocessed rows; that is, it is the number of rows Essbase accepts before processing. Row processing eliminates missing rows. After processing, the number of rows that the client can retrieve depends on spreadsheet-defined limits.
    If SSPROCROWLIMIT is exceeded, Essbase issues an error message and stops processing the request.
    If using Advanced Interpretation mode in the Add-in, one cannot turn this setting off from the spreadsheet. The setting is not used in Freeform mode.
    Cheers,
    Mehmet

  • BIB - problem with retrieving metadata

    Hi,
    I've Oracle 9i 9.2.0.2 (Win) installed, Oracle JDeveloper 9.0.3 and the latest BI Java Beans.
    When I'm trying to run sample bibdemo, I receive messages that connection to Olap Service was established but failed to retrieve metadata
    Any suggestions?
    Slawek

    Sorry but with the limited information it is difficult to figure out the problem. However, my first question would be do you have the Windows 9.2.0.2.1 patch set installed correctly? A lot of users have failed to perform the Post Install steps from the readme such as running catpatch.sql. (Understandably so because the readme is HUGE!) Please take a look at my post on this OLAP forum with the title "9.2.0.2 Patch". There you will find abbreviated install instructions regarding the 9.2.0.2.1 patch set. Make sure you have actually completed the install process.
    Also, the BI Beans have posted on OTN a client configuration diagnostic utility. The purpose of it is to gather information about your configuration that will help you and Oracle Support Services diagnose problems. You can find it at the following OTN link:
    http://otn.oracle.com/products/bib/content.html
    Hope this helps.

  • Pixelation problems with Live and Recorded Viewing

    I'm having massive pixelation when viewing live HD channels or viewing recorded HD shows.  When watching live TV the problem is active when I turn on a 2nd TV.  We had tech support out and the trouble shooting did not resolve the problem.  They thought it was related to bandwith.  I'm not well versed on the technology, and don't feel as if I need to understand why their product is not working as it should.  I'm paying for a product that is not functioning.  What do I need to do as a consumer to obtain the customer service that is expected from AT&T?

    Call and schedule another tech visit...Or download the Hyatt app, login with your att email account/password, run the troubleshoot test. This runs 5 tests, any problems found with these will help create a service ticket, if receive a green check mark, no problem found within tests ran. As you report increased issue with two TVs on, I suspect your on coax with cable issue. Inside wiring issues are billable, minimum $99 labor plus $55 for each cable run.If coax cable, looking at ends (compressed not screw or from), cable itself should be RG 6 not RG59, old wall plates, splitter (should only be one, Holland brand). If replacing the physical connections do not work, actually cable bad (store bought, RG59) best to either install up to two wireless receivers (one time charge $49 each) or have tech replace coax with cat5 ($55 per line) Are other issues possible, yes... But coax best describe your issue....Other possibilities include flaky receiver (replace receiver), failing port on RG (replace RG), or other wiring issues outside or inside... Test at nid for errors, no errors at nid is inside wiring issue. Foreign voltage from TV (especially newer TV with amplifier) needing TV grounded requiring you to have grounded outlets (electrician job if not grounded), bad ac power, many use power strip that goes flaky replace the power strip or plug direct into wall outlet.  As problem is listed as recent, something changed, what is question and who is responsible for repair (paying to fix). If can rule out inside (electric/cable runs your issue) then equipment and outside is company issue.  Request another service call, a fresh set of eyes main reveal something previous tech missed.

  • Problem with the garbage record getting printed at the beginning

    Hello Friends,
    I know that this problem is very difficult to solve without looking at my script and its program. But I will try asking anyways.
    I have written the following code (Driver program) which uses to tables ZRAMCUSTMAST AND ZRAMCALLMAST.
    ZRAMCUSTMAST has customer details like address etc.,
    ZRAMCALLMAST has the call details that each
                 customer has done.
    But when I print the details, it prints everything correctly but for each customer it prints some garbage
    values as the first row.
    Any feedback will be greatly appreciated. You can mail me the response also (singer_ram AT yahoo DOT com)
    CODE in my driver program (SE38) -
    *& Report  ZRAMPROJSCRIPT                                              *
    REPORT  zramprojscript                          .
    TABLES : zramcustmast, zramjuncmast, zramcallmast.
    DATA : itabcustmast LIKE zramcustmast OCCURS 1 WITH HEADER LINE,
           itabjuncmast LIKE zramjuncmast OCCURS 1 WITH HEADER LINE,
           itabcallmast LIKE zramcallmast OCCURS 1 WITH HEADER LINE.
    DATA: type_of_call(1),
          CALL_CHARGE type i, CALL_CHARGE_STRING(5), TOTAL_CHARGE type i,
          hour(2), min(2), sec(2).
    SELECT * FROM zramcustmast INTO TABLE itabcustmast.
    *SELECT * FROM zramjuncmast INTO TABLE itabjuncmast.
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
      APPLICATION                       = 'TX'
      ARCHIVE_INDEX                     =
      ARCHIVE_PARAMS                    =
      DEVICE                            = 'PRINTER'
      dialog                            = 'X'
       form                              = 'ZRAMPROJSCRIPT'
       language                          = sy-langu
      OPTIONS                           =
      MAIL_SENDER                       =
      MAIL_RECIPIENT                    =
      MAIL_APPL_OBJECT                  =
      RAW_DATA_INTERFACE                = '*'
    IMPORTING
      LANGUAGE                          =
      NEW_ARCHIVE_PARAMS                =
      RESULT                            =
    EXCEPTIONS
      CANCELED                          = 1
      DEVICE                            = 2
      FORM                              = 3
      OPTIONS                           = 4
      UNCLOSED                          = 5
      MAIL_OPTIONS                      = 6
      ARCHIVE_ERROR                     = 7
      INVALID_FAX_NUMBER                = 8
      MORE_PARAMS_NEEDED_IN_BATCH       = 9
      SPOOL_ERROR                       = 10
      CODEPAGE                          = 11
      OTHERS                            = 12
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT itabcustmast.
      CALL FUNCTION 'START_FORM'
       EXPORTING
      ARCHIVE_INDEX          =
         form                   = 'ZRAMPROJSCRIPT'
         language               = sy-langu
      STARTPAGE              = ' '
      PROGRAM                = ' '
      MAIL_APPL_OBJECT       =
    IMPORTING
      LANGUAGE               =
    EXCEPTIONS
      FORM                   = 1
      FORMAT                 = 2
      UNENDED                = 3
      UNOPENED               = 4
      UNUSED                 = 5
      SPOOL_ERROR            = 6
      CODEPAGE               = 7
      OTHERS                 = 8
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'WRITE_FORM'
       EXPORTING
         element                        = 'MAINPAGE'
         function                       = 'SET'
         type                           = 'BODY'
         window                         = 'MAIN'
    IMPORTING
      PENDING_LINES                  =
    EXCEPTIONS
      ELEMENT                        = 1
      FUNCTION                       = 2
      TYPE                           = 3
      UNOPENED                       = 4
      UNSTARTED                      = 5
      WINDOW                         = 6
      BAD_PAGEFORMAT_FOR_PRINT       = 7
      SPOOL_ERROR                    = 8
      CODEPAGE                       = 9
      OTHERS                         = 10
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      clear itabcallmast.
      refresh itabcallmast.
      SELECT * FROM zramcallmast INTO TABLE itabcallmast WHERE customerid = itabcustmast-customerid.
      SORT itabcallmast by calltype.
      TOTAL_CHARGE = 0.
      LOOP AT itabcallmast.
    Local Call : 1 Rupee per Minute.
    STD : 1.5 Rupees Per Minute
    International calls : 5 Rupees Per minute
    hour = itabcallmast-CALLDURATION+0(2).
    min = itabcallmast-CALLDURATION+2(2).
    sec = itabcallmast-CALLDURATION+4(2).
    CASE itabcallmast-calltype.
    WHEN 'L'.
        CALL_CHARGE = ( ( hour * 60 * 60 ) + ( min * 60 ) + ( sec ) ) / 60.
    WHEN 'S'.
        CALL_CHARGE = ( ( ( hour * 60 * 60 ) + ( min * 60 ) + ( sec ) ) * 2 ) / 60  .
    WHEN 'I'.
        CALL_CHARGE = ( ( ( hour * 60 * 60 ) + ( min * 60 ) + ( sec ) ) * 5 ) / 60   .
    ENDCASE.
    CALL_CHARGE_STRING = CALL_CHARGE.
    TOTAL_CHARGE = TOTAL_CHARGE + CALL_CHARGE.
        CALL FUNCTION 'WRITE_FORM'
         EXPORTING
           element                        = 'MAINPAGE'
           function                       = 'SET'
           type                           = 'BODY'
           window                         = 'MAIN'
    IMPORTING
      PENDING_LINES                  =
    EXCEPTIONS
      ELEMENT                        = 1
      FUNCTION                       = 2
      TYPE                           = 3
      UNOPENED                       = 4
      UNSTARTED                      = 5
      WINDOW                         = 6
      BAD_PAGEFORMAT_FOR_PRINT       = 7
      SPOOL_ERROR                    = 8
      CODEPAGE                       = 9
      OTHERS                         = 10
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDLOOP.   " ************ itabCALLmast
      CALL FUNCTION 'END_FORM'
    IMPORTING
      RESULT                         =
    EXCEPTIONS
      UNOPENED                       = 1
      BAD_PAGEFORMAT_FOR_PRINT       = 2
      SPOOL_ERROR                    = 3
      CODEPAGE                       = 4
      OTHERS                         = 5
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    clear itabcallmast.
    ENDLOOP.   " ************** itabCUSTmast
    CALL FUNCTION 'CLOSE_FORM'
    IMPORTING
      RESULT                         =
      RDI_RESULT                     =
    TABLES
      OTFDATA                        =
    EXCEPTIONS
      UNOPENED                       = 1
      BAD_PAGEFORMAT_FOR_PRINT       = 2
      SEND_ERROR                     = 3
      SPOOL_ERROR                    = 4
      CODEPAGE                       = 5
      OTHERS                         = 6
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    hi
    good
    check the following things-
    1- Check the value for the field in the particular table,
    2- Check the data you r passing from the driver program and the field that is printing the value in the sapscript screen.
    3-check in the debug mode when the value is printing in the first row.
    thanks
    mrutyu

  • Problem with inserting new records in Oracle Forms

    Hi Friends,
    I am a new user to Oracle Forms and I need a help from you people. The problem is as follows:
    I have a data block in which I can display a number of records. In this data block the user will be able to edit the fields if no child records are found in another table. I have used when-new-record-instance to attain this scenario. All are text items. One item licensee_id which is made invisible by setting the property in property palette and required=no ( as this is the primary key of the table). Also the audit columns are made invisible.
    The code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
         v_cnt                          NUMBER;
    BEGIN
         SELECT COUNT (*)
    INTO v_cnt
    FROM id_rev_contracts
    WHERE licensee_id = :ID_REV_LICENSEES.licensee_id;
    IF v_cnt > 0 THEN
    set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_FALSE);
    ELSE
         set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_TRUE);
         -- set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', INSERT_ALLOWED, PROPERTY_TRUE);
    END IF;
    END;
    Now in this data block I should also be able to insert new records and for the same I have used PRE-INSERT trigger and the code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
    CURSOR v_licensee_id IS SELECT id_rev_licensees_s.NEXTVAL FROM dual;
    BEGIN
    OPEN v_licensee_id;
    FETCH v_licensee_id INTO :id_rev_licensees.licensee_id;
    CLOSE v_licensee_id;
    IF :id_rev_licensees.licensee_id IS NULL THEN
    Message('Error Generating Next v_licensee_id');
    RAISE Form_Trigger_Failure;
    END IF;
    :ID_REV_LICENSEES.created_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.last_updated_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.create_date := SYSDATE;
    :ID_REV_LICENSEES.last_update_date := SYSDATE;
    EXCEPTION
    WHEN form_trigger_failure
    THEN
    RAISE form_trigger_failure;
    WHEN OTHERS
    THEN
    v_alert_button :=
    msgbox ('ERROR in Pre-Insert - ' || SQLERRM, 'STOP', 'Contact IST');
    RAISE form_trigger_failure;
    END;
    Every thing is compiling fine but at the run time when I am trying to insert a new record I am receiving the following error:
    FRM-40508:ORACLE error:unable to insert record
    I also think the pre-insert record is not firing at the time of inserting a new record and saving it. So I request you to please delve into this problem and suggest me how to overcome this problem. Code snippets would do more help for me. If you need any other things from me please let me know. I will see if I could be of any help in that concern because I may not be able to send the entire form as it is.
    Thanks and regards,
    Vamsi K Gummadi.

    first of all
    pre-insert fires after the implicit/explicit commit/commit_form is issued and before the real insert is submitted to the db.
    i would suggest to remove the error handling part for the moment
    because i believe you might be getting "ora-xxxx cannot insert null"
    and also make visible the primary column to check if the pre-insert is executed.
    it would be better to make visible for a while the not null columns of the table/block
    i suppose that the block is insert allowed and you are using table as the source of the block and not any procedures or something...

  • Problem in retrieving multiple records SAP xMII from SAP using BAPIS

    Hi friends,
             In SAP xMII i called BAPI_USER_GETLIST by passing import parameters 10 and y.In r/3 BAPI returned 10 rows but In xMII it was returned only one Record.
    i want to display 10 records in sap xmii
    1) I created to connection ECC5 in Dataservices-->SAPSERVERConfiguration
    2)In BLS we placed JCO Interface inside Sequence
    3)In BLS I used ECC5 connectrion(using JCO Interface) and called  BAPI_USER_GELLIST
    4)In Links-->Transaction created two input values for "maxnoofrows","withusername" and output value is "userid".
    Input what i mapped 
    Transaction>"maxnoofrows" =====SAPJCOINTERFACE->Request>BAPI_USER_GETLIST>INPUT-->MAX_ROWS
    Transaction>"withusername" =====SAPJCOINTERFACE->Request>BAPI_USER_GETLIST>INPUT-->WITH_USERNAME
    Output what i mapped 
    SAPJCOINTERFACE->Response>BAPI_USER_GETLIST>TABELS>USERLITS >ITEM>USERNAME=====Transaction-->userid
    5)Saved the Transaction.
    6)In Query Template -->xactuateQuery selected
    7)In Datasource Query mode was selected ,Inputrarams i passed 10 and y as parameters.
    It was returned one user id from R/3 inSAP xMII
    please help me to retrive all  10 rows from r/3
    Regards
    Srikanth

    hi,
    What is the data type of Transaction output (userid)?
    Make this as XML type.
    The format which BAPI returns the result does not match with xMII XML format.
    Create a xMII XML document and configure with column name as userid. and by using repeater and XML row add all tho values to the document. Then assign whole doument to transaction output.
    Hope this will help to resolve the issue.
    Regards,
    Kishore

Maybe you are looking for