Editable JComboBox -Saving itz new value in the database.

Hi,
I have a Combobox say Product , in which some fields (like -> tv , hand blender etc) comes from Database and i have added one more field say others ,
in others field user can enter new product name and it shd be saved in the same database, i have used editable jcombobox but dnt no how to proceed further.
Thanks & Regards
Komal

And make a provision to delete wrong entries, or you'll end up with all the typos stored separately.
I speak from experience. I actually have such a combo in several of my VFP applications (not in Java though)
db

Similar Messages

  • Not reflecting the new value of the AWvariable

    I am working with Jdeveloper and BI beans
    we are using Java Analytical workspace API for connecting and saving the user input as a Analytical workspace Variable
    by using fallowing code
    awConn.executeCommand("awvariable=value");
    here the problem is i can not made this assignment perminent in Analytical Workspace
    i.e after execution of the program i checked with AnallyticalworkSpace manager's worksheet it not reflecting the new value of the AWvariable. It is showing only old value.
    how can i do that assignment it from java api .
    any one can help me

    That other post looks different, though - the OP is now manipulating the model.The OPs statement of the problem was:
    Adding new data to the exitsting model causes the JList to display blank when I refresh the screen.
    The suggestion in the other posting was to change the model not the array and the tutorial has a working example of this.
    The OPs question was:
    When my action performed creates a new instance of the model everything works fine but is this how it should work?
    The answer to this is no, you don't need to change the model, just update the model.
    So if the OP read the other posting and read the tutorial they should have an answer to their problem.
    As you suggested there is no need to create a custom model. The example in the tutorial uses the default list model, if the OP read the tutorial they would know that.

  • Adding a new value at the beginning of the list

    Hi,
    I've a list of values which are hard coded in the 'Elements in List' property for a Combo Box. Now, I want to add a new value at the beginning of the list. It doesn't allow me to add one. I have to delete all values and re-enter from the first which includes the new one. Is there any way that I can add a new value at the beginning of the list without having to remove other values.
    Thanks in advance.
    -- Srinivas

    Hi ,
    In order to implement the appropriate moves you have to use the key combinations : 1) <shift>+<ctrl>+'<' for deletion of the current list item(where the cursor is located)
    2)<shift>+<ctrl>+'>' for appending a blank row in order to add a new element...
    Regards,
    Simon

  • Add new values to the Domain J_1BINDUS3 CFOP category of the material

    Hello Gurus
    I have a request from the business to include some new values in the domain J_1BINDUS3 CFOP category of the material.
    Since is a standard object seems to be a work Basis team, however before requesting this I would like to get some advice from the experts to understand if adding new values to this domain can cause side effects or if I should maintain other objects as result of this request.
    I know table J_1BAON has to be maintained to properly determine CFOPs for the new fields but along that is there any other one?
    Is this the right process to include new CFOP categories?
    The requirement is to properly identify Assets as Productive and Non Productive when making the PO, since this can help us to determine tax code automatically.

    Have you tried using "Map published data" in the Utilities pane, mapping the department field to the corresponding security group.
    http://codebeaver.blogspot.dk/

  • Add New value to the special reference indicator on the TO field

    Can you please tell me how to add a new value to the special reference indicator dropdown which is on the transfer order. 
    LTAK->SPEZI  ?  Currently it is displaying values  A & B in the drop down and want to add a new value to the indicator.
    Thanks
    John

    Hi,
    I dont think you will be able to add more values to this field from configuration.
    If you check the data element and domain associated with this field (LTAK_SPEZI) in SE11. You can see that the value range for the domain has been defined there as  A and B only.
    So if you want to add a new value you can ask and ABAP/technical consulatnt to add new values to this Domain.
    However i am not sure it will be useful (unless you have a specific requirement and want to modify the standard programs) as the field is checked in different program (eg in inculde  LL03AF4V , LL03AF7F ) against these fixed values A and B.

  • Bookmark: default filters lost when adding a new value on the filter

    Dear all,
    Sometime I need to go back to a bookmark and add extra GL accounts /or GL hierarchy node but I found that is often loses the original selection when I click the transfer button after select the new GL account/or GL hierarchy node. Is there any way to add a new value to the existing filter?
    Best Regards

    <FONT FACE = "Tahoma", Font Color = "Blue">
    Hi<br>
    1. Open the bookmark<br>
    2. Click on any field from the context menu and create another bookmark<br>
    3. Put additional filters and press the transfer button<br>
    4. The data will be displayed for (old + new) selections<br>
    5. Click on any field from the context menu and create another bookmark. Make a note of it<br>
    <br> Step 2 should not really be required but I'm assuming that your internet session was expired or similar problem. Please try this and let us know what happens.<br>
    <br>
    Hope it helps.<br><br>
    Cheers Abhijit<br>
    </FONT><FONT FACE = "Verdana", Font Color = "Red">
    removed
    </FONT>

  • Error while inserting BLOB value in the database

    I am trying to insert a BLOB value in the database. This action results in the following exception:
    java.sql.SQLException: ORA-22925: operation would exceed maximum size allowed for a LOB value
    The method i am using is as follows:
    public void insertBlob(Connection Con, StringBuffer Message)throws SQLException
    String Query = "INSERT INTO MSGBLOCKS (MSGDB_ID, MSGBLOCKTYPE, MESSAGE) VALUES (20, 1 , ?)";
    PreparedStatement PS = Con.prepareStatement(Query);
    byte[] bytes = new String(Message).getBytes();
    ByteArrayInputStream bi = new ByteArrayInputStream(bytes);
    PS.setBinaryStream(1, bi, bytes.length);
    PS.executeUpdate();
    The manifest file of ojdbc14.jar being used is: 10.1.0.5.0 and I am using jdk 1.4.
    Also the message being tried to insert is of 9 Kb only.
    Any help would be greatly appreciated.
    Thanks!!!

    Did you check if the Message is having only that small 9kb of data? also check the maximum allowed size for that column in the Oracle DB, the size can be restricted to 8Kb also.
    Edited by: DynamicBasics on Jul 28, 2010 5:54 PM

  • Refresh jTable after inserting new data into the Database

    Hey all,
    I'm using Netbeans 6.5 to create a Desktop Application which is connected to a Java DB (Derby).
    The first simple steps were all very successfull:
    Create the jTable and bind it to the Database => everything works fine. When the application starts it correctly shows all data from the database.
    The problem starts when I try to insert new data to the database.
    For that reason I've created textfields and a button "Save". When I press the button it successfully inserts the data to the database but they are not displayed in the jTable (when the application starts they are all there, they are not updated at runtime) . I've tried table.invalidate() and table.repaint() but they just don't work.
    Any help will be GREATLY appreciated. But please have in mind that most of the code is Netbeans-generated and most of it not editable.
    Many thanks in advance.
    George

    Once again you are right my friend. I jumped to conclusion way too fast, when I shouldn't. (Give me a break, I've been busting my head with this well over a week). The response I saw when I did that was that indeed a line is added to the jTable. Because I falsly set the index of the object to be added to be second to last the row appeared on the table, what I didn't see at the time was that the last one disappeared. Hmm...
    A new adventure begins...
    So after a few hours of messing around with it here are my observations:
    1) It was not an observable list. When I add the new element with employeesList.add(newEmp); , the table gets notified but a get a bunch of exceptions:
    xception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 84, Size: 84
            at java.util.ArrayList.RangeCheck(ArrayList.java:546)
            at java.util.ArrayList.get(ArrayList.java:321)
            at org.jdesktop.swingbinding.impl.ListBindingManager$ColumnDescriptionManager.validateBinding(ListBindingManager.java:191)
            at org.jdesktop.swingbinding.impl.ListBindingManager.valueAt(ListBindingManager.java:99)
            at org.jdesktop.swingbinding.JTableBinding$BindingTableModel.getValueAt(JTableBinding.java:713)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
            at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
            at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1897)
            at javax.swing.plaf.ComponentUI.update(ComponentUI.java:154)
            at javax.swing.JComponent.paintComponent(JComponent.java:743)
            at javax.swing.JComponent.paint(JComponent.java:1006)
            at javax.swing.JViewport.blitDoubleBuffered(JViewport.java:1602)
            at javax.swing.JViewport.windowBlitPaint(JViewport.java:1568)
            at javax.swing.JViewport.setViewPosition(JViewport.java:1098)
            at javax.swing.plaf.basic.BasicScrollPaneUI$Handler.vsbStateChanged(BasicScrollPaneUI.java:818)
            at javax.swing.plaf.basic.BasicScrollPaneUI$Handler.stateChanged(BasicScrollPaneUI.java:807)
            at javax.swing.DefaultBoundedRangeModel.fireStateChanged(DefaultBoundedRangeModel.java:348)
            at javax.swing.DefaultBoundedRangeModel.setRangeProperties(DefaultBoundedRangeModel.java:285)
            at javax.swing.DefaultBoundedRangeModel.setValue(DefaultBoundedRangeModel.java:151)
            at javax.swing.JScrollBar.setValue(JScrollBar.java:441)
            at javax.swing.plaf.basic.BasicScrollBarUI.scrollByUnits(BasicScrollBarUI.java:907)
            at javax.swing.plaf.basic.BasicScrollPaneUI$Handler.mouseWheelMoved(BasicScrollPaneUI.java:778)
            at javax.swing.plaf.basic.BasicScrollPaneUI$MouseWheelHandler.mouseWheelMoved(BasicScrollPaneUI.java:449)
            at apple.laf.CUIAquaScrollPane$XYMouseWheelHandler.mouseWheelMoved(CUIAquaScrollPane.java:38)
            at java.awt.Component.processMouseWheelEvent(Component.java:5690)
            at java.awt.Component.processEvent(Component.java:5374)
            at java.awt.Container.processEvent(Container.java:2010)
            at java.awt.Component.dispatchEventImpl(Component.java:4068)
            at java.awt.Container.dispatchEventImpl(Container.java:2068)
            at java.awt.Component.dispatchMouseWheelToAncestor(Component.java:4211)
            at java.awt.Component.dispatchEventImpl(Component.java:3955)
            at java.awt.Container.dispatchEventImpl(Container.java:2068)
            at java.awt.Component.dispatchEvent(Component.java:3903)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
            at java.awt.Container.dispatchEventImpl(Container.java:2054)
            at java.awt.Window.dispatchEventImpl(Window.java:1801)
            at java.awt.Component.dispatchEvent(Component.java:3903)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 84, Size: 84
            at java.util.ArrayList.RangeCheck(ArrayList.java:546)
            at java.util.ArrayList.get(ArrayList.java:321)
            at org.jdesktop.swingbinding.impl.ListBindingManager$ColumnDescriptionManager.validateBinding(ListBindingManager.java:191)
            at org.jdesktop.swingbinding.impl.ListBindingManager.valueAt(ListBindingManager.java:99)
            at org.jdesktop.swingbinding.JTableBinding$BindingTableModel.getValueAt(JTableBinding.java:713)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
    ... and a lot morewhich from my poor understanding means that the jTable succesfully notices the change but it is not able (??) to adjust to the new change. What is more interesting is that when I plainly add the element to the end of the list (without an idex that is), a blank row appears at the end of my Table. The weird thing is that I've bound the table to some text fields below it, and when I select that empty row all the data appear correctly to the text fields.
    I tried going through:
                    org.jdesktop.observablecollections.ObservableCollections.observableList(employeesList).add(newEmp);as well as
                    help = org.jdesktop.observablecollections.ObservableCollections.observableListHelper(employeesList);
                    help.getObservableList().add(newEmp);
                    help.fireElementChanged(employeesList.lastIndexOf(newEmp));and
                    obsemployeesList = org.jdesktop.observablecollections.ObservableCollections.observableList(employeesList);
                    obsemployeesList.add(newEmp);and I still get the same results (both the exeptions and the mysterious empty row at the end of the table
    So, I'm again in terrible need of your advice. I can't thank you enough for the effort you put into this.
    Best regards,
    George
    Edited by: tougeo on May 30, 2009 11:06 AM
    Edited by: tougeo on May 30, 2009 11:21 AM
    Edited by: tougeo on May 30, 2009 11:30 AM

  • Initial value and value in the database

    Hello world ,
    i want to add initial value with value in the database depend on the date
    for example i have initial value for 30/09/2009
    i and to all it with value in the database in 31/12/2009
    take a look what i did
    PROCEDURE pkd_prem IS
    cursor gr_pkd_prem is select
    SUM(DECODE(mark,'01',FM_mark,TM_mark) A,
    SUM(DECODE(FMS,'01',LS,NS) b
    from fr_treaty_profile ftp, fr_monthly_summary
    where
    (ftp.tpr_cgp_id = fr_monthly_summary.fms_cgp_id )
    AND (ftp.tpr_cmp_id = fr_monthly_summary.fms_cmp_id )
    AND (ftp.tpr_treaty_origin = fr_monthly_summary.fms_treaty_origin )
    AND (ftp.tpr_uw_year = fr_monthly_summary.fms_uw_year )
    AND (ftp.tpr_class = fr_monthly_summary.fms_class )
    AND (ftp.tpr_type = fr_monthly_summary.fms_type )
    AND (ftp.tpr_serial = fr_monthly_summary.fms_serial )
    AND
    (fr_monthly_summary.fms_treaty_origin=:BLK1.EO_ORIGIN) AND
    (fr_monthly_summary.fms_uw_year=:BLK1.EO_UW_YEAR) AND
    (fr_monthly_summary.fms_class=:BLK1.EO_CLASS) AND
    (fr_monthly_summary.fms_treaty_type=:BLK1.EO_TYPE) AND
    ( fr_monthly_summary.fms_treaty_serial=:BLK1.EO_SERIAL)
    AND (FMS_TYPE ='P')
    AND FMS_SERIAL = '01'
    AND (FMS_OFC_ID !='X')
    and (FMS_YEAR =substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),7,4))
    and (FMS_PERIOD between substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)-2 and substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)) ;
    ---Initial value
    cursor base is select EO_GR_BKD_PREM from FR_EN
    where
    EO_TREATY_ORIGIN=:BLK1.EO_ORIGIN AND
    EO_UW_YEAR=:BLK1.EO_UW_YEAR AND
    EO_CLASS=:BLK1.EO_CLASS AND
    EO_TREATY_TYPE=:BLK1.EO_TYPE AND
    EO_TREATY_SERIAL=:BLK1.EO_SERIAL AND
    EO_YEAR=:BLK1.EO_YEAR;
    A number(18,3);
    B number(18,3);
    v_base number(18,3);
    BEGIN
    open base;
    open gr_pkd_prem;
    fetch gr_pkd_prem into a,b;
    fetch base into v_base;
    :BLK1.EO_GR_BKD_PREM :=nvl(a,0)+ nvl(b,0)+ nvl(v_base,0);
    close gr_pkd_prem;
    close base;
    END;
    the proceudre is correct and the values come as i want
    but here
    FMS_PERIOD between substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)-2 and substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2))
    suppose i will add from 6 to 9
    the value will come down to add with base value
    but next time i want from 10 to 12
    it will add value 10 to 12 with the base for just period 10 to 12
    i want to keep adding
    if i start from 6 to 9
    then shoud be
    add the value of 6 to 9 to 10 to 12
    but

    look ..
    i created a form and let's say there is one field called Base ..
    and i inert value on that field and saved .
    then
    i created cursor to fetch value from another table
    that value which i fetched from another table must add to past value
    take this scenario
    i started with value 6
    then i fetch by cursor value from 1/1/2010 to 31/3/2010 and that value = 33
    first action
    6+33
    then
    i fecth by using cursor from 1/6/2010 to 30/9/2010 and that value = 2
    the result of first action must add with the last value which is 2
    (6+33) from first action plus(+) 2 and display the result on the secreen

  • Placing null values in the database

    Hi
    I'm using a PreparedStatement object to try to input a null value in the database. I'm using the following code :
    pstmt = connection.prepareStatement("INSERT INTO Conditions (Deal,ConditionDate,Condition ) VALUES (?,?,?)");
    pstmt.setString(1,"aDealName");
    pstmt.setNull(2,Types.TIMESTAMP);
    pstmt.setString(3,"aCondition");
    pstmt.executeUpdate();
    and I get the "SQL Data type out of range" error message.
    Does anyone know what might be the problem?
    Thanks for any help
    LGS

    Hi
    Sorry for the lack of info.
    I am using Microsoft Access 2000, the JDBC-ODBC driver v.4.00.6019
    and my TableModel class is as follows:
    public class MyTableModel2 extends AbstractTableModel
    private Connection conn;
    private Vector rows,columnHeads,firstColumn,columnTypes,columnWidths;
    private Validation validate;
    private String query;
    private int numColumns;
    String tableType;
    String [] columnNamesFrontPage = {"Deal","Spread","Next Event Date","Closing Date"};
    String [] columnNamesCommentsPage  = {"Date","Input By","Spread","Comment"};
    String [] columnNamesTimetable = {"Date","Event"};
    String [] columnNamesConditionsTable = {"Date","Condition"};
    private DBase2 db2;
    private String tableName,primKeyColName;
    public MyTableModel2 ()
    {} //Empty Constructor
    public MyTableModel2 ( Connection dbConn,String aQuery,String table)
      conn = dbConn;
      rows = new Vector();
      columnHeads = new Vector();
      query = aQuery;
      tableType = table;
      firstColumn = new Vector();
      db2 = new DBase2 (dbConn);
      columnTypes = new Vector();
      columnWidths = new Vector();
      validate = new Validation();
    }//End of Constructor
    public int getColumnCount ()
      return columnHeads.size();
    }//End of Method
    public int getRowCount ()
      return rows.size();
    }//End of Method
    public Object getValueAt(int aRow, int aColumn)
      Vector row = (Vector)rows.elementAt(aRow);
      return row.elementAt(aColumn);
    }//End of Method
    public String getColumnName (int column)
      String columnName = "";
      if(tableType == null)
       columnName = columnHeads.get(column).toString();
      else if (tableType == "FrontPage")
       columnName = columnNamesFrontPage [column];
      else if (tableType == "CommentsPage")
       columnName = columnNamesCommentsPage [column];
      else if (tableType == "Timetable")
       columnName = columnNamesTimetable [column];
      else if (tableType == "ConditionsTable")
       columnName = columnNamesConditionsTable [column];
      return columnName;
    }//End of Method
    public void query() 
      try {
       Statement statement = conn.createStatement();
       ResultSet rs = statement.executeQuery(query);
       ResultSetMetaData rsmd = rs.getMetaData();
       tableName = rsmd.getTableName(1);
       Integer i2;
       boolean moreRecords = rs.next();
       for (int i = 1; i <= rsmd.getColumnCount(); ++i)
         if (i == 1)
          primKeyColName = rsmd.getColumnName(i);
         else
          columnHeads.addElement(rsmd.getColumnName(i));
          if (rsmd.getColumnTypeName(i).equals("DATETIME"))
           i2 = new Integer (8);
          else
           int i1 = rsmd.getColumnDisplaySize(i);
           i2 = new Integer (i1);
          columnWidths.add(i2);
          String colTypeName = rsmd.getColumnTypeName(i);
          columnTypes.addElement(colTypeName);
          //JOptionPane.showMessageDialog(null,"Column Width="+i2,"Column Types  ",JOptionPane.INFORMATION_MESSAGE);
       do {
          rows.addElement( getNextRow (rs,rsmd));
       while (rs.next() );
      catch ( SQLException sqlex )
        sqlex.printStackTrace();
      }//End of Method
    private Vector getNextRow( ResultSet rs, ResultSetMetaData rsmd )
           throws SQLException
        Vector currentRow = new Vector();
         for ( int i = 1; i <= rsmd.getColumnCount(); ++i )
           Object o = rs.getObject(i);
           if (o == null)
             String emptyCell = "";
             currentRow.addElement(emptyCell);
           else if(o.getClass().toString().equalsIgnoreCase("class java.sql.Timestamp") )
             SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy");
             String formatted = sdf.format(o);
             currentRow.addElement(formatted);
           else
             if (i == 1)
              firstColumn.addElement(o);
             else
             currentRow.addElement(o);
          return currentRow;
        }//End of Method
    public void refresh ()
      rows.clear();
      firstColumn.clear();
      try {
       Statement statement = conn.createStatement();
       ResultSet rs = statement.executeQuery(query);
       ResultSetMetaData rsmd = rs.getMetaData();
       boolean moreRecords = rs.next();
       do {
          rows.addElement( getNextRow (rs,rsmd));
       while (rs.next() );
      catch ( SQLException sqlex )
        sqlex.printStackTrace();
      this.fireTableDataChanged();
    }//End of Method
    public boolean isCellEditable (int row, int col)
      return true;
    }//End of Class
    public void setValueAt(Object value, int row, int col)
       String objToString = value.toString();
       int columnWidth = Integer.parseInt(columnWidths.elementAt(col).toString());
       if(objToString.length() > columnWidth)
        validate.errorMessageDisplay("Maximum column width is "+columnWidth+" characters - Please retype","INPUT ERROR");
       else if (columnTypes.elementAt(col).toString().equals("DATETIME") && validate.validDateInput(objToString) == false)
        validate.errorMessageDisplay("Date is required in form dd/mm/yy - Please retype","INPUT ERROR");
       else if (columnTypes.elementAt(col).toString().equals("DOUBLE") && validate.validNumberInput(objToString) == false)
        validate.errorMessageDisplay("This column will accept numbers only - Please retype","INPUT ERROR");
       else
       //JOptionPane.showMessageDialog(null,columnTypes.elementAt(col).toString(),"Column Name  ",JOptionPane.INFORMATION_MESSAGE);
       Vector rowA = (Vector)rows.elementAt(row);
       rowA.setElementAt(value,col);
       fireTableCellUpdated(row, col);
       String newInput = value.toString();
       int id = Integer.parseInt(firstColumn.elementAt(row).toString());
       String colName = columnHeads.elementAt(col).toString();
       String query = "UPDATE "+tableName+" SET "+colName+" = '"+newInput+"' WHERE "+primKeyColName+" = "+id+"";
       db2.modifyDatabase(query);
       refresh();
      }//End of Method The method in which I am using PreparedStatement is:
    public void updateConditionsTable (String aDealName, String aCondition) 
       int result = 0;
       try
        pstmt = connection.prepareStatement("INSERT INTO Conditions (Deal,ConditionDate,Condition )"+
        " VALUES (?,?,?)");
       // pstmt = connection.prepareStatement("INSERT INTO Conditions (Deal,ConditionDate,Condition )"+
       // " VALUES (?,?,?)");
        pstmt.setString(1,aDealName);
        pstmt.setNull(2,Types.INTEGER);
        pstmt.setString(3,aCondition);
        pstmt.executeUpdate();
       catch (SQLException sqlex ) {
         //sqlex.printStackTrace();
         String output = "YOUR INPUT IS NOT VALID - PLEASE TRY AGAIN\n";
         output = output + sqlex.toString();
         JOptionPane.showMessageDialog(null,output,"SQL Error",JOptionPane.INFORMATION_MESSAGE);
        //return result;
       }//Closes Method Once again, thanks for any help

  • Sending the Value to the database of the selected item in the radioButton

    I want to pass  the value to the database that I selected on the radioButton
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
         <mx:Text y="36" text="The Christian and Missionary Alliance Churches of the Philippines, Inc" width="581" fontWeight="bold" fontSize="15" horizontalCenter="46"/>
         <mx:Text y="59" text="( C A M A C O P)" fontWeight="bold" fontSize="12" horizontalCenter="8"/>
         <mx:Text y="77" text="MEMBERSHIP IDENTIFICATION FORM" width="502" fontSize="17" fontWeight="bold" textAlign="center" horizontalCenter="0"/>
         <mx:Text y="101" text="Date: " width="47" fontWeight="bold" textAlign="center" horizontalCenter="-71"/>
         <mx:DateField y="99" id="dateToday" horizontalCenter="18" editable="true" width="140" enabled="true"/>
         <mx:Label y="153" text="District:" fontWeight="bold" horizontalCenter="-418"/>
         <mx:TextInput y="151" maxChars="15" id="district" width="249" enabled="true" horizontalCenter="-260"/>
         <mx:Text y="179" text="Name of Local Church:" fontWeight="bold" horizontalCenter="-378"/>
         <mx:TextInput y="177" width="400" id="nameLocalChurch" maxChars="255" enabled="true" horizontalCenter="-104"/>
         <mx:Text y="205" text="Local Church Address:" fontWeight="bold" horizontalCenter="-378"/>
         <mx:TextInput y="203" width="401" id="addressLocalChurch" maxChars="255" enabled="true" horizontalCenter="-105"/>
         <mx:Text y="231" text="Name:" fontWeight="bold" horizontalCenter="-422"/>
         <mx:TextInput y="229" width="489" id="givenName" maxChars="255" enabled="true" horizontalCenter="-149"/>
         <mx:Text y="254" text="(Given Name/Middle Name/Family Name - CAPITALIZE)" fontStyle="italic" horizontalCenter="-158"/>
         <mx:Text y="284" text="Position in the Church: " fontWeight="bold" horizontalCenter="-376"/>
         <mx:TextInput y="276" width="401" id="posInChurch" maxChars="225" enabled="true" horizontalCenter="-105"/>
         <mx:Text y="310" text="Profession/Title:" fontWeight="bold" horizontalCenter="-393"/>
         <mx:TextInput y="306" width="434" id="professionTitle" maxChars="225" enabled="true" horizontalCenter="-121"/>
         <mx:Text y="333" text="Community Involvement/Work" fontWeight="bold" horizontalCenter="-351"/>
         <mx:Text y="355" text="Gift Skill:" fontWeight="bold" horizontalCenter="-415"/>
         <mx:TextInput y="353" width="475" enabled="true" horizontalCenter="-142" id="giftSkill" maxChars="225"/>
         <mx:Text y="381" text="Home Address:" fontWeight="bold" horizontalCenter="-397"/>
         <mx:TextInput y="379" width="448" id="homeAddress" enabled="true" horizontalCenter="-128" maxChars="225"/>
         <mx:Text y="406" text="Status:" fontWeight="bold" horizontalCenter="-420"/>
         <mx:Text y="432" text="Date of Marriage:" fontWeight="bold" horizontalCenter="-391"/>
         <mx:TextInput y="430" enabled="true" id="dateOfMarriage" horizontalCenter="-258" maxChars="225"/>
         <mx:Text y="432" text="(If Married)" fontWeight="normal" fontStyle="italic" horizontalCenter="-144"/>
         <mx:Text y="458" text="Tel./Cell Phone:" fontWeight="bold" horizontalCenter="-396"/>
         <mx:TextInput y="456" width="436" id="cell" enabled="true" horizontalCenter="-122" maxChars="225"/>
         <mx:Text y="484" text="SSS/GSIS No." fontWeight="bold" horizontalCenter="-402"/>
         <mx:TextInput y="482" width="215" id="sss" enabled="true" maxChars="15" horizontalCenter="-243"/>
         <mx:Label y="484" text="Blood Type" fontWeight="bold" horizontalCenter="-94"/>
         <mx:TextInput y="482" width="154" id="bloodType" enabled="true" maxChars="15" horizontalCenter="19"/>
         <mx:Text y="509" text="Height" fontWeight="bold" horizontalCenter="-421"/>
         <mx:Text y="510" text="Weight" fontWeight="bold" horizontalCenter="-279"/>
         <mx:TextInput y="508" id="weight" enabled="true" maxChars="15" horizontalCenter="-168"/>
         <mx:Text y="510" text="Birthday" fontWeight="bold" horizontalCenter="-53"/>
         <mx:Text y="536" text="TIN No." fontWeight="bold" horizontalCenter="-420"/>
         <mx:TextInput y="534" id="tin" enabled="true" horizontalCenter="-311" maxChars="225"/>
         <mx:Text y="536" text="Date of Baptism" fontWeight="bold" horizontalCenter="-174"/>
         <mx:Text y="536" text="(If Baptized)" fontStyle="italic" horizontalCenter="32"/>
         <mx:Text y="573" text="Annual Income:" fontWeight="bold" height="18" fontSize="13" horizontalCenter="-384"/>
         <mx:RadioButton y="563" label="Below 10K" id="first" enabled="true" horizontalCenter="-276" groupName="annualIncome"/>
         <mx:RadioButton y="593" label="76k-100k" id="fifth" enabled="true" horizontalCenter="-192" groupName="annualIncome"/>
         <mx:RadioButton y="563" label="11k-20k" id="second" enabled="true" horizontalCenter="-195" selected="false" groupName="annualIncome"/>
         <mx:RadioButton y="563" label="21k-40k" id="third" enabled="true" horizontalCenter="-116" selected="false" groupName="annualIncome"/>
         <mx:RadioButton y="593" label="101k-above" id="sixth" enabled="true" horizontalCenter="-106" groupName="annualIncome"/>
         <mx:RadioButton y="593" label="41k-75k" id="fourth" enabled="true" horizontalCenter="-280" groupName="annualIncome"/>
         <mx:Text y="589" text="(The &quot;k&quot; = thousand)" horizontalCenter="-383" fontStyle="italic"/>
         <mx:TextInput y="508" id="hayt" enabled="true" width="76" horizontalCenter="-356" maxChars="15"/>
         <mx:Text text="In case of Emergency Please Notify" fontSize="12" fontWeight="bold" horizontalCenter="-326" y="621"/>
         <mx:Text y="642" text="Name:" fontWeight="bold" horizontalCenter="-370"/>
         <mx:TextInput y="640" id="EName" enabled="true" width="446" horizontalCenter="-125" maxChars="225"/>
         <mx:Text y="668" text="Address:" fontWeight="bold" horizontalCenter="-363"/>
         <mx:TextInput y="666" width="434" id="EAddress" enabled="true" horizontalCenter="-117" maxChars="225"/>
         <mx:Text y="740" text="Endorsement/Signature of PASTOR" fontWeight="bold" fontSize="12" horizontalCenter="-298"/>
         <mx:Text y="740" text="Signature of Member" fontWeight="bold" fontSize="12" width="208" horizontalCenter="55"/>
         <mx:Text y="804" text="Endorsement/Signature of DMS" fontWeight="bold" fontSize="12" horizontalCenter="-310"/>
         <mx:Text y="806" text="Confirmation of the BISHOP/PRESIDENT" fontWeight="bold" fontSize="12" horizontalCenter="88"/>
         <mx:Text y="867.7" text="Reminders" fontSize="15" fontWeight="bold" horizontalCenter="-76"/>
         <mx:Text y="899.25" text="Pastor/CMT shall verify each filled up membership form." fontWeight="bold" textAlign="center" fontSize="12" horizontalCenter="-86"/>
         <mx:Text y="921.8" text="The pastor will endorse the forms to their respective DMS." fontWeight="bold" fontSize="12" textAlign="center" horizontalCenter="-78"/>
         <mx:Text y="942.35" text="The donation for I.D. is 50.00php." fontWeight="bold" textAlign="center" fontSize="12" horizontalCenter="-62"/>
         <mx:Text y="961.9" text="Get your receipts from the DMS as a whole." fontWeight="bold" textAlign="center" fontSize="12" horizontalCenter="-69"/>
         <mx:Text y="980.35" text="Check carefully the neatness of I.D. pictures." fontWeight="bold" fontSize="12" textAlign="center" horizontalCenter="-64"/>
         <mx:Text y="997.9" text="This form is to be completed by all CAMACOP members and workers." fontWeight="bold" fontSize="12" horizontalCenter="-83"/>
         <mx:Spacer x="47" y="9"/>
         <mx:Button y="1034" label="Submit" id="submit" enabled="true" horizontalCenter="-89" click = "sample1.send()"/>
         <mx:DateField y="508" id="birthday" enabled="true" horizontalCenter="35" width="122"/>
         <mx:DateField y="534" width="105" id="dateOfBaptism" enabled="true" horizontalCenter="-64"/>
         <mx:RadioButtonGroup id="work"/>
         <mx:RadioButton x="273" y="331" label="Private" groupName="work" width="80" id="prayvate" enabled="true"/>
         <mx:RadioButton x="416" y="331" label="NGO" groupName="work" enabled="true" id="NGO"/>
         <mx:RadioButton x="359" y="331" label="GO" groupName="work" enabled="true" id="GO"/>
         <mx:RadioButtonGroup id="status"/>
         <mx:RadioButton x="133" y="404" label="Married" groupName="status" id="Married"/>
         <mx:RadioButton x="207" y="404" label="Single" groupName="status" id="Single"/>
         <mx:RadioButton x="274" y="404" label="Widow" groupName="status" id="Widow"/>
         <mx:RadioButton x="342" y="404" label="Widower" groupName="status" id="Widower"/>
         <mx:HTTPService id="sample1" method="POST" url="http://localhost/frontPage-debug/add.php">
              <mx:request xmlns="">
                   <dateToday>
                        {dateToday.text}
                   </dateToday>
                   <district>
                        {district.text}
                   </district>
                   <nameLocalChurch>
                        {nameLocalChurch.text}
                   </nameLocalChurch>
                   <addressLocalChurch>
                        {addressLocalChurch.text}
                   </addressLocalChurch>
                   <givenName>
                        {givenName.text}
                   </givenName>
                   <posInChurch>
                   {posInChurch.text}
                   </posInChurch>
                   <professionTitle>
                   {professionTitle.text}
                   </professionTitle>
                   <work>
                        {work.text}
                   </work>
                   <giftSkill>
                        {giftSkill.text} <!--THIS IS WHERE THE ERROR HAPPENS-->
                   </giftSkill>
                   <homeAddress>
                        {homeAddress.text}
                   </homeAddress>
                   <status>
                        {status.text} <!--THIS IS WHERE THE ERROR HAPPENS-->
                   </status>
                   <dateOfMarriage>
                        {dateOfMarriage.text}
                   </dateOfMarriage>
                   <cell>
                        {cell.text}
                   </cell>
                   <bloodType>
                        {bloodType.text}
                   </bloodType>
                   <sss>
                        {sss.text}
                   </sss>
                   <weight>
                        {weight.text}
                   </weight>
                   <birthday>
                        {birthday.text}
                   </birthday>
                   <tin>
                        {tin.text}
                   </tin>
                   <dateOfBaptism>
                        {dateOfBaptism.text}
                   </dateOfBaptism>
                   <annualIncome>
                        {annualIncome.text}          
                   </annualIncome>
                   <EName>
                        {EName.text}
                   </EName>
                   <EAddress>
                        {EAddress.text}
                   </EAddress>
              </mx:request>     
         </mx:HTTPService>     
    </mx:Application>
    This is are the errors
    1119: Access of possibly undefined property text through a reference with static type mx.controls:RadioButtonGroup.  
    1120: Access of undefined property annualIncome.

    Hi,
    instead of
    {status.text}
    should be {status.selection.label} (status.selection is a RadioButton or null and after that you can get label property). It's better to set one of the variants in radioButtonGroup to selected and do not check null selection or selectedValue property.
    It seems that {giftSkill.text} is ok, but {work.text} above it has the same problem as I've described above.

  • How to Save the multiple selection check box values into the database

    i have the multiple selection check box implemented in UI through drop down list,i can choose the desired values from the drop down through checkbox, but i m unable to store these values and commit the values into the database all at a time.

    You can access the values using listbinding and can then store them as a string by using a delimiter.

  • JComboBox: arrowkey-selection : keep value of the display area

    Hello!
    I need to have a combobox where the user can iterate through its items using the arrowkeys without changing the value on the displayField. This should only change when the user presses Return.
    Does anyone knows how should I proceed in order to have this behaviour?
    Thank you,
    Pedro

    Hi,
    I know a solution.
    You use only a JTextField , set in editable false and implements a MouseListener. So when the user click on the JTextFied a ComboBoxPopup opens( where you want - normaly under the textfield).
    these code you need :
    // for the DefaultComboBoxPopup
    import javax.swing.plaf.basic.BasicComboPopup;
    // construct an instance using your old JComboBox
    BasicComboPopup bcp = new BasicComboPopup(yourComboBox);
    /** Later in the code you can use the ComboPopup like a normal  JPopupMenu to show the popup and hide the popup and set the location of it*/
    bcp.setLocation(x, y);
    bcp.setVisible(true);Then you must only install a ListSelectionListener or a Keyboard and a MouseListener on the JComboBox to react on user-input, to store the selected value in the JTextField.
    Olek

  • How to record value of field to perform action when saving with new value

    Hi,
    I have a multi-tabbed form (Forms 6i). I need to include code so that when a field is changed on one tab and is saved, then I need to update some fields on the other tabs.
    My first question is: How can I record a copy of the field whenever data is brought into the form (ie: through a query), and then what is the best way to update the other data:
    1) Update the database and then requery somehow
    2) Update the fields on the other tabs and then commit to the database?
    And roughly I how I do it?
    Any help appreciated
    Adam

    > if the user is inserting a new record and I try and use the DATABASE_VALUE property on that field.... what is going to happen?
    Read the on-line help for Database_value. Use :System.record_status to determine if the record is being inserted, then don't get database_value. It is not clear, but I believe on such records, it returns the current value of the item, not a null value. Regardless, it is useless.
    If you want to update fields in other blocks in your form automatically based on changes in a different block, you can start a non-repeating timer in a when-validate-item trigger on the field. When the timer expires, you can navigate to the other blocks and to various records, and update the fields in the other blocks. Then when the user commits, all changes will be applied together. The only trick to using a timer like that is that in the commit process, you also need to check to see if the timer exists, and if it does, delete the timer and do the updates to the other tables.

  • New value in the screen

    i have 2 parameters  (x,y) on the screen.
    my demmand is :when i put values in x,and livving the paramter with "click" or "tab"  (not enter)
    i will have new value in y.
    example  :  x---5
                y--empty
    click on y--- i get new value like 3.

    Hi,
    It is not possible.Since clicking on a input field wont trigger PAI...
    Regards,
    Abdul
    Message was edited by: Abdul Hakim

Maybe you are looking for