Update a table in the database from a report

The user needs to print a report multiple times for the day but needs to knwo whether or not the data was already printed so that it is not printed again...therefore I have a y/n/all field on the report to allow the user to choose what subsets of data to print...
Problem is, how do I actually update the data base table and the subset of records currently printed as printed from the report runtime....how do I code this ...
Please help......

oyu can use the following to insert or update in data base from reports
CMD_LINE := 'insert into Table values
('''||:toDate||''','||a||')';
SRW.DO_SQL(CMD_LINE);
CMD_LINE := 'update Table set net = '||a||'
where ddate ='''||:todate||'''';
commit ;

Similar Messages

  • UPDATING A TABLE IN THE DATABASE

    I was just wonderng if u had 2 Java applications 1 ,a replica of another.Each application updates the exact same table with information in a database.If both applications are run at the exact same time what would happen,would it have any effect on the database?or would it do any harm?

    The chances of two applications running at exactly the same time are miniscule. If they each have a connection to the database, and are both trying to modify the same table, then chances are one will be slightly after the other its changes would be committed last. In the case where one might delete a row just before another tries to access that row, you're going to have some sort of problem. However, those circumstances are pretty rare, and even so, some small amount of exception handling can deal with them gracefully.

  • Updating a table with the data from the select list

    I have 2 select lists on a page...first select list displays vendor no and vendor name from the table vendor (vendor_no, vendor_name, address, city, state, zip, ph no)
    second list displays contact no and contact name from the table contact (contact_no, contact_name, email_addrs)
    i have a submit button...once it is clicked the vendor_no from the first list and the contact_no from the second list must be inserted into the third table vendor_contact (vendor_contact_no, contact_no, vendor_no) and also there must be a condition to check if the entry already exists or not...can any one tell me how this can be done...

    Why not design your page just on your third table (vendor_contact), and those fields (which will already be defined as part of that table) can be defined there as your select lists. Then make sure you have a Primary Key (or Unique Key) defined on the table to prevent duplicates.
    It makes for a much cleaner looking page, and far easier to implement as well.
    Hope this made sense and helps.
    Bill Ferguson

  • Updating metadata in OWB after modifying tables in the database

    Hi All,
    In our data warehouse, one key field will suffer a change in data precision, from number(4) to number(5). This field exists in several tables across the database and I have created a procedure to alter all related tables in Oracle (10g). Is there a way to create a similar procedure or script to modify the metadata in OWB in order to reflect the changes in the altered tables from the database? I think the script should refresh the tables in the metadata but I'm not sure if it would be necessary to sincronize or validate the related mappings.
    I'm newbie in OWB so I'm not sure whether this is achievable or not.
    Thanks in advance for your guidance.
    Regards,
    Mauricio
    Edited by: mcruz on 21/03/2010 17:07

    Below is a OMBPlus tcl script to set the precision and scale of a specific column name in all tables of the current oracle module
    Prerequisite is that you have made the connection to the OWB repository in OMBPlus (OMBCONNECT) and have set the context to the right oracle module (OMBCC and set OMBPROMPT ON, the latter to display your current context in the prompt)
    Happy scripting.
    proc set_nbr_len {p_objtyp p_col_name p_scale p_precision} {
       set tbls [OMBLIST ${p_objtyp}S]
       foreach tbl $tbls {
          set cols [OMBRETRIEVE $p_objtyp '$tbl' GET COLUMNS '$p_col_name']
          foreach col $cols {
           set dattyp [OMBRETRIEVE $p_objtyp '$tbl' COLUMN '$col' \
                         GET PROPERTIES (DATATYPE)]
           if { [string first "NUMBER" $dattyp] != -1 } {
                puts "Column $col scale & precision reset in $p_objtyp $tbl"
                    OMBALTER $p_objtyp '$tbl' MODIFY COLUMN '$col' SET PROPERTIES \
                         (SCALE, PRECISION) VALUES \
                   ('$p_scale', '$p_precision')
       OMBCOMMIT
    set_nbr_len TABLE <your column name> <your precision> <your scale>

  • Can we update the data from SSRS report to any database ?

    Hi Team,
    Greetings !!!!
    Can we update the data from SSRS report to any database ?
    Thanks,
    Anand Gavle.

    Nope SSRS doesnt have write back options. Its just a reporting tool
    However one thing you can do is to link a webpage from SSRS report and do the changes through it
    SSRS has the ability to navigate to web page through which you can capture any data inputs from users and save it to your db.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to delete duplicate records in all tables of the database

    I would like to be able to delete all duplicate records in all the tables of the database. Many of the tables have LONG columns.
    Thanks.

    Hello
    To delete duplicates from an individual table you can use a construct like:
    DELETE FROM
        table_a del_tab
    WHERE
        del_tab.ROWID <> (SELECT
                                MAX(dups_tab.ROWID)
                          FROM
                                table_a dups_tab
                          WHERE
                                dups_tab.col1 = del_tab.col1
                          AND
                                dups_tab.col2 = del_tab.col2
                          )You can then apply this to any table you want. The only differences will be the columns that you join on in the sub query. If you want to look for duplicated data in the long columns themselves, I'm pretty sure you're going to need to do some PL/SQL coding or maybe convert them to blobs or something.
    HTH
    David

  • Newbie ques : How to get the list of all tables in the database

    Hi,
    I'm very new to Oracle (using Oracle8i currently). I wanted to know if there is a way to get the list of all tables in the database. Like in mySQL you can use the command " show tables" to get the list of all the tables.
    Any help will e greatly appreciated. Please "cc" any reply to [email protected] also.
    thanks
    Deven

    Hi
    Select table_name, owner from all_tables;
    will give u all the tables in the database.
    all_tables, dba_tables, user_tables
    all_objects, dba_objects, dba_objects
    there are many, more tables. login as system and query the tab and try to describe the tables.
    Thanks
    Malar

  • When target DB is down in which table is the data from source is stored, also where are the error messages stored in ODI

    When target DB is down in which table is the data from source is stored, also where are the error messages stored in ODI( I am not getting any error message in E$_TARGET_ANI_TEST).
    When i am running the interface i am getting the below error against the errored step
    "ORA-01045: user ABC lacks CREATE SESSION privilege; logon denied."
    Only E$_TARGET_ANI_TEST  is created with no data. No such tables like C$_0TARGET_ANI_TEST, I$_TARGET_ANI_TEST are created and also data is not inserted in the target table TARGET_ANI_TEST.

    Hi,
    I have checked that only E$ table is created. C$ and I$ table are not created ( I have selected my target schema as the part for the staging table).
    All the parameters for dropping the tables are selected as "<default>:false".
    I am importing the following KMs with the following parameters:
    1) CKM Oracle
    DROP_ERROR_TABLE
    :false
    DROP_CHECK_TABLE
    :false
    CREATE_ERROR_INDEX
    :true
    COMPATIBLE
    :9
    VALIDATE
    :false
    ENABLE_EDITION_SUPPORT
    :false
    UPGRADE_ERROR_TABLE
    :false
    2) LKM SQL to SQL
    DELETE_TEMPORARY_OBJECTS
    :true
    3) IKM SQL Incremental Update
    INSERT
    :true
    UPDATE
    :true
    COMMIT
    :true
    SYNC_JRN_DELETE
    :true
    FLOW_CONTROL
    :true
    RECYCLE_ERRORS
    :false
    STATIC_CONTROL
    :false
    TRUNCATE
    :false
    DELETE_ALL
    :false
    CREATE_TARG_TABLE
    :false
    DELETE_TEMPORARY_OBJECTS
    :true 

  • Datapump skipping partitioned tables in the database

    I have run expdp on Oracle 10.2.0.4.0 on AIX 5.6 Platform, the export runs well exporting rows in the database but when it comes to partitioned tables in the database it export no rows for all the partitioned tables. When I run a normal exp/imp the partitioned tables are exported with all their rows.
    I used the following commands:
    expdp system/****** dumpfile=export_data.dmp directory=DATA_PUMP_DIR full=y logfile=export_dump.log
    Output for expdp on partitioned table:
    . . exported "SCOTT"."DEPT":"DEPT_2003_P1" 0 KB 0 rows
    . . exported "SCOTT"."DEPT":"DEPT_2003_P10" 0 KB 0 rows
    . . exported "SCOTT"."DEPT":"DEPT_2003_P11" 0 KB 0 rows
    . . exported "SCOTT"."DEPT":"DEPT_2003_P12" 0 KB 0 rows
    . . exported "SCOTT"."DEPT":"DEPT_2003_P2" 0 KB 0 rows
    . . exported "SCOTT"."DEPT":"DEPT_2003_P3" 0 KB 0 rows
    . . exported "SCOTT"."DEPT":"DEPT_2003_P4" 0 KB 0 rows
    . . exported "SCOTT"."DEPT":"DEPT_2003_P5" 0 KB 0 rows
    . . exported "SCOTT"."DEPT":"DEPT_2003_P6" 0 KB 0 rows
    . . exported "SCOTT"."DEPT":"DEPT_2003_P7" 0 KB 0 rows
    . . exported "SCOTT"."DEPT":"DEPT_2003_P8" 0 KB 0 rows
    . . exported "SCOTT"."DEPT":"DEPT_2003_P9" 0 KB 0 rows
    And for exp:
    exp system/****** file=export_dump.dmp full=y log=export_log1.log
    Result from the export log for partitioned tables:
    . . exporting partition DEPT_2005_P1 881080 rows exported
    . . exporting partition DEPT_2005_P2 1347780 rows exported
    . . exporting partition DEPT_2005_P3 2002962 rows exported
    . . exporting partition DEPT_2005_P4 2318227 rows exported
    . . exporting partition DEPT_2005_P5 3122371 rows exported
    . . exporting partition DEPT_2005_P6 3916020 rows exported
    . . exporting partition DEPT_2005_P7 4217100 rows exported
    . . exporting partition DEPT_2005_P8 4125915 rows exported
    . . exporting partition DEPT_2005_P9 1913970 rows exported
    . . exporting partition DEPT_2005_P10 1100156 rows exported
    . . exporting partition DEPT_2005_P11 786516 rows exported
    . . exporting partition DEPT_2005_P12 822976 rows exported
    I am not sure about this behavour from datapump, my database is more than 800GB and we want to migrate the database from AIX to LINUX.
    Thanks

    Sorry I just copied and pasted some extracts from my exp and expdp logs:
    For testing purposes I tried to run a datapump export of only 1 partitioned table in the database and its going through, but when I do the same on a full datapump export these partitioned tables are being exported with no rows.
    Export: Release 10.2.0.4.0 - 64bit Production on Tuesday, 02 August, 2011 12:18:47
    Copyright (c) 2003, 2007, Oracle. All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Starting "SYSTEM"."SYS_EXPORT_TABLE_01": system/******** dumpfile=DEPT.dmp tables=scott.dept logfile=dept1.log
    Estimate in progress using BLOCKS method...
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 48.50 GB
    Processing object type TABLE_EXPORT/TABLE/TABLE
    Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
    Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
    Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
    Processing object type TABLE_EXPORT/TABLE/COMMENT
    Processing object type TABLE_EXPORT/TABLE/RLS_POLICY
    Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
    Processing object type TABLE_EXPORT/TABLE/TRIGGER
    Processing object type TABLE_EXPORT/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
    Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
    Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    . . exported "SCOTT"."DEPT":"DEPT_2009_P6" 1.452 GB 7377736 rows
    . . exported "SCOTT"."DEPT":"DEPT_2009_P7" 1.363 GB 6935687 rows
    . . exported "SCOTT"."DEPT":"DEPT_2008_P6" 1.304 GB 6656096 rows
    . . exported "SCOTT"."DEPT":"DEPT_2010_P7" 1.410 GB 7300618 rows
    . . exported "SCOTT"."DEPT":"DEPT_2008_P7" 1.296 GB 6641073 rows
    . . exported "SCOTT"."DEPT":"DEPT_2010_P6" 1.328 GB 6863885 rows
    . . exported "SCOTT"."DEPT":"DEPT_2007_P6" 1.158 GB 6568075 rows
    . . exported "SCOTT"."DEPT":"DEPT_2009_P5" 1.141 GB 5801822 rows
    . . exported "SCOTT"."DEPT":"DEPT_2011_P5" 1.162 GB 6027466 rows
    . . exported "SCOTT"."DEPT":"DEPT_2007_P7" 1.100 GB 6214680 rows
    . . exported "SCOTT"."DEPT":"DEPT_2011_P6" 1.106 GB 5762303 rows
    . . exported "SCOTT"."DEPT":"DEPT_2010_P5" 1.133 GB 5859492 rows
    . . exported "SCOTT"."DEPT":"DEPT_2007_P5" 1.001 GB 5664315 rows
    . . exported "SCOTT"."DEPT":"DEPT_2008_P5" 1.023 GB 5229356 rows
    . . exported "SCOTT"."DEPT":"DEPT_2010_P8" 1.078 GB 5549666 rows
    . . exported "SCOTT"."DEPT":"DEPT_2007_P8" 940.3 MB 5171379 rows
    . . exported "SCOTT"."DEPT":"DEPT_2008_P8" 989.0 MB 4920276 rows
    . . exported "SCOTT"."DEPT":"DEPT_2009_P8" 918.6 MB 4553523 rows
    . . exported "SCOTT"."DEPT":"DEPT_2006_P6" 821.0 MB 5220879 rows
    . . exported "SCOTT"."DEPT":"DEPT_2008_P4" 766.6 MB 3832262 rows
    . . exported "SCOTT"."DEPT":"DEPT_2006_P8" 747.9 MB 4753538 rows
    . . exported "SCOTT"."DEPT":"DEPT_2006_P7" 741.8 MB 4708242 rows
    . . exported "SCOTT"."DEPT":"DEPT_2010_P4" 734.2 MB 3713567 rows
    . . exported "SCOTT"."DEPT":"DEPT_2005_P7" 661.4 MB 4217100 rows
    . . exported "SCOTT"."DEPT":"DEPT_2005_P8" 647.1 MB 4125915 rows
    . . exported "SCOTT"."DEPT":"DEPT_2011_P4" 677.8 MB 3428887 rows
    I also tried to run a normal schema by schema export with the normal exp system/password command the and got my dump file which is about 300GB, when I run the imp system/password command and specify fromuser=<system > and touser=<schemas_in_the_dumpfile> seperated by commas, it just comes up with this message:
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Export file created by EXPORT:V10.02.01 via conventional path
    import done in WE8ISO8859P9 character set and AL16UTF16 NCHAR character set
    Import terminated successfully without warnings.
    No tables are exported.
    If I specify the parameter imp system/password file=dept_export.dmp full=y log=dept_imp.log with the same dumpfile and it imports data from the dumpfile into my database.
    I am not sure what could be wrong with my dumpfile or my imp command and its parameters.

  • Table in the Database will be changed, what is impact

    Hi, I'm new to the Forum.
    We have a multiple reports build in the multiple Business arias, One of the Tables in the Database will be changed. My question is what is the best way to use EUL5 to see what impact it will make. I will appreciate any advise.

    When you say one of the tables in the database will be changed, do you mean columns will be added, or are some columns going away, column names changing, tablename changing or what?
    If the table is just getting some new columns added, then no problem. Your existing reports will still be fine and when you perform a refresh on the business area where the folder is pointing to your table, it will just pick up the new items.
    If columns are going away, then your reports will get an error if they refer to that column name via the folder. You can do a kludge to cover this for the short term. In the folder in Admin, you can add a calculation with the exact same name as the column that's going away. Then - if it's a character - put in some kind of striking phrase like 'Russ Was Here'. Then when the existing reports are run, you'll see the phrase and know you just have to delete it from the report. Once all gone from all reports - you can delete the condition from the folder.
    Hopefully you can see the reliance on the Discoverer folder having to have a non-changing table. The easier thing to do for the future - is to create a database view that points to the table. Then if the table changes in ANY way (well, except from being deleted altogether with no replacement table), you can always fix the view to return proper data and as your Disco folder is pointing to the view, nothing changes.
    Hey this is what NoetixViews does, what BIS view do, etc. - it's IMHO the best way to go for future development.
    Russ

  • How to know which table in the database a form is accessing

    Actually Im new to oracle applications,
    Im getting an error when i open a form from system administrator responsibility saying that table doesnot exist.
    My basic doubt is, how to know which table in the database a form is accessing.
    Any response is higly appreciated.
    Thanks,
    Praveen
    Edited by: user10239520 on Sep 10, 2008 7:07 AM

    Take a look at the following thread:
    Is there a query log in EBS?
    Re: Is there a query log in EBS?

  • Updating a column in the database

    Hi,
    My requirement is to update a column in the database just before calling
    OAException.raiseBundledOAException(getExceptionList());
    I am calling the above in a method in the AM
    Just before calling this I am Getting the handle of the VO (which is based on an EO, which in turn is based on the table which I want to update) and setting the value of that column as null. But the value is not getting updated at the database level.
    When I query the database I can still see the earlier value and not the updated value.
    In some cases I can see the value on the screen is updated but the value in the database remains same.
    Please let me know how do I update a column in the database and
    Thanks
    Meenal

    Hi,
    I guess, since an excpetion is raised the transaction is not commited automatically by the framework.
    Try commiting the transaction explicity after the update and before the exception. But i dont think, its a good design... anybody any idea ?!

  • Query to find the biggest table in the database..!!!

    Hello everybody,
    i have more than 600 tables in the database i need to find the biggest table in the database and want to order it in descending pattern..
    Is there any query for this task...
    Rgds
    Harsh.

    What version of Oracle? Do you use the CBO or the RBO? If you use the CBO, are your statistics accurate? Can you tolerate having approximate rowcounts?
    SELECT table_name, num_rows
      FROM user_tables
    ORDER BY num_rowsmay be what you're looking for, but
    - num_rows is populated when you gather statistics, so it'll be empty if you're using the RBO
    - num_rows may be an approximate number, depending on how you're gathering statistics
    - num_rows only reflects the size at the instant you gathered statistics. It is not maintained in real time.
    I'm guessing, though, that this is close enough for whatever you're doing.
    Justin

  • "Failed to update binary data in the database".

    Hi,
    we will get this message ("Failed to update binary data in the database".) when one of our customers want to install our add-on in one specific server.
    they got a copy of their database and put in another computer and could install add-on. but they can not install add-on on their main server.
    please advice me.

    Hi Senthil,
    Thanks for your consideration,
    They checked and they don’t have any record in SARI table related to R1. they have one record for XLR only.
    This problem is only on one specific server.
    Do you have any other idea? Please help us.
    Regards,
    Neda

  • Add data to the table in the database with the use of add button

    The name of my database is Socrates.
    The name of the table in the database is Employees
    I want to be able to add data to the database. i am presently working on the add button such that when i enter date into the textfield and press the add button it should automatically register in the table.
    The error upon compilation is with this line of code
    If (ae.getSource() == jbtnA)// it says that ";" is expected
    Below is the entire code
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Mainpage extends JFrame implements ActionListener
         JTextField jFirstName = new JTextField(15);
         JTextField jSurname = new JTextField(12);
         JTextField jCity = new JTextField(10);
         JTextField jCountry = new JTextField(12);
         JTextField jSSN = new JTextField(8);
         JLabel jFirstLab = new JLabel("First Name");
         JLabel jSurnameLab = new JLabel("Surname");
         JLabel jCityLab = new JLabel("City");
         JLabel jCountryLab = new JLabel("Country");
         JLabel jSSNLab = new JLabel("Social Security Number (SSN)");
         JButton jbtnA = new JButton ("Add");
         JButton jbtnPrv = new JButton ("Previous");
         JButton jbtnNt = new JButton ("Next");
         JButton jbtnDl= new JButton ("Delete");
         JButton jbtnSrch = new JButton ("Search");
         public Mainpage (String title)
              super (title);
              Container cont = getContentPane();
              JPanel pane1 = new JPanel();
              JPanel pane2 = new JPanel();
              JPanel pane3 = new JPanel();
              pane1.setLayout (new GridLayout (0,1));
              pane2.setLayout (new GridLayout(0,1));
              pane3.setLayout (new FlowLayout());
              pane1.add(jFirstLab);
              pane1.add(jSurnameLab);     
              pane1.add(jCityLab);
              pane1.add(jCountryLab);
              pane1.add(jSSNLab);
              pane2.add(jFirstName);
              pane2.add(jSurname);
              pane2.add(jCity);
              pane2.add(jCountry);
              pane2.add(jSSN);
              pane3.add(jbtnA);
              pane3.add(jbtnPrv);
              pane3.add(jbtnNt);
              pane3.add(jbtnDl);
              pane3.add(jbtnSrch);
              cont.add(pane1, BorderLayout.CENTER);
              cont.add(pane2, BorderLayout.LINE_END);
              cont.add(pane3, BorderLayout.SOUTH);
              jFirstName.addActionListener(this);
              jSurname.addActionListener(this);
              jCity.addActionListener(this);
              jCountry.addActionListener(this);
              jSSN.addActionListener(this);
              jbtnA.addActionListener(this);
              jbtnPrv.addActionListener(this);
              jbtnNt.addActionListener(this);
              jbtnDl.addActionListener(this);
              jbtnSrch.addActionListener(this);
              validate();
              setVisible(true);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              pack();
              setResizable(false);
         public void actionPerformed(ActionEvent ae)
                   If (ae.getSource() == jbtnA)
                                    fst = jFirstName.getText();
                        srn = jSurname.getText();
                        cty = jCity.getText();
                        cnty = jCountry.getText();
                        int sn =
    Interger.parseInt(jSSN.getText());
                                    String ad = "Insert into Employees
    (Firstname,Surname,City,Country,SSN)" +
    "values('"fst"','"srn"','"cty"','"cnty"','"sn"')";
                        Statement stmt = con.createStatment();
                        int rowcount = stmt.executeUpdate(ad);
                        JOptionPane.showMessageDialog("Your
    details have been registered");
                        Statement stmt = con.createStatment();
                        int rowcount = stmt.executeUpdate(ad);
    public static void main (String args[])
              Mainpage ObjFr = new Mainpage("Please fill this
    registration form");
              try
                   Class.forname("sun.jdbc.odbc.JdbcOdbcDriver");
                   String plato = "jdbc:odbc:socrates";
                   Connection con =
    DriverManager.getConnection(plato);
              catch(SQLException ce)
                   System.out.println(ce);
    }

    i have restructured the code, but the following line of code is giving error:
    String plato = jdbc:odbc:socrates;
    the entire code is below:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.sql.*;
    public class Mainpage extends JFrame implements ActionListener
         JTextField jFirstName = new JTextField(15);
         JTextField jSurname = new JTextField(12);
         JTextField jCity = new JTextField(10);
         JTextField jCountry = new JTextField(12);
         JTextField jSSN = new JTextField(8);
         JLabel jFirstLab = new JLabel("First Name");
         JLabel jSurnameLab = new JLabel("Surname");
         JLabel jCityLab = new JLabel("City");
         JLabel jCountryLab = new JLabel("Country");
         JLabel jSSNLab = new JLabel("Social Security Number (SSN)");
         JButton jbtnA = new JButton ("Add");
         JButton jbtnPrv = new JButton ("Previous");
         JButton jbtnNt = new JButton ("Next");
         JButton jbtnDl= new JButton ("Delete");
         JButton jbtnSrch = new JButton ("Search");
         Statement stmt;
            String ad;
            public Mainpage (String title)
              super (title);
              Container cont = getContentPane();
              JPanel pane1 = new JPanel();
              JPanel pane2 = new JPanel();
              JPanel pane3 = new JPanel();
              pane1.setLayout (new GridLayout (0,1));
              pane2.setLayout (new GridLayout(0,1));
              pane3.setLayout (new FlowLayout());
              pane1.add(jFirstLab);
              pane1.add(jSurnameLab);     
              pane1.add(jCityLab);
              pane1.add(jCountryLab);
              pane1.add(jSSNLab);
              pane2.add(jFirstName);
              pane2.add(jSurname);
              pane2.add(jCity);
              pane2.add(jCountry);
              pane2.add(jSSN);
              pane3.add(jbtnA);
              pane3.add(jbtnPrv);
              pane3.add(jbtnNt);
              pane3.add(jbtnDl);
              pane3.add(jbtnSrch);
              cont.add(pane1, BorderLayout.CENTER);
              cont.add(pane2, BorderLayout.LINE_END);
              cont.add(pane3, BorderLayout.SOUTH);
              jFirstName.addActionListener(this);
              jSurname.addActionListener(this);
              jCity.addActionListener(this);
              jCountry.addActionListener(this);
              jSSN.addActionListener(this);
              jbtnA.addActionListener(this);
              jbtnPrv.addActionListener(this);
              jbtnNt.addActionListener(this);
              jbtnDl.addActionListener(this);
              jbtnSrch.addActionListener(this);
              validate();
              setVisible(true);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              pack();
              setResizable(false);
              try
                   Class.forname(sun.jdbc.odbc.JdbcOdbcDriver);
                   String plato = jdbc:odbc:socrates;
                   Connection con = DriverManager.getConnection(plato);
                   stmt = con.createStatment();
              catch(SQLException ce)
                   System.out.println(ce);
              catch(ClassNotFoundException ce)
                   System.out.println(ce);
         public void actionPerformed(ActionEvent ae)
                   try
                        if(ae.getSource().equals(jbtnA))
                                         fst = jFirstName.getText();
                             srn = jSurname.getText();
                             cty = jCity.getText();
                             cnty = jCountry.getText();
                             int sn = Interger.parseInt(jSSN.getText());
                                         ad = "Insert into Employees
    values('"+fst+"',"+srn+"','"+cty+"','"+cnty+"','"+sn+"')";
                             stmt.executeUpdate(ad);
                             JOptionPane.showMessageDialog(this, "Your details have been
    registered");
                   catch(SQLException ce)
                        System.out.println(ce);
    public static void main(String args[])
              Mainpage ObjFr = new Mainpage("Please fill this registration form");
    }

Maybe you are looking for

  • Lion finder window not displaying file info

    I have a MacPro which I've updated to Lion. I have four hard drives installed. When I open a finder window from three of the drives, I get the expected (from Snow Leopard) behavior: in icon view, images display pixel dimensions,  movies or audio file

  • Export Project Tasks to Excel using VBA by Custom Field

    Question referring to the link: http://social.technet.microsoft.com/Forums/projectserver/en-US/9c46458c-893f-41ba-bd46-bdb59c533f4a/export-project-tasks-to-excel-using-vba-by-custom-field?forum=project2010custprog Help needed. I have inserted my ques

  • Constant Correlation

    Hi I have been trying to figure out the reasons why my BPM is not working. I am using constant as correlation in my BPM. When I configured the CC s I kept the polling interval for input files at 60 seconds and as a reult many instances were triggered

  • Mac Book Pro as field monitor?

    Would it be possible to use the Mac Book Pro (the new 15" or 17") as a field monitor when shooting with a Sony PMW-EX3? That would be neat to use the screen as a field monitor, then edit on the same machine... Wouldn't that save in not having to have

  • SQL Query : Getting specific datatype in select clause

    Hi I want to write one query that returns me the values inside a table based on the datatype of column(s) of the table. For e.g. I need only those columns of the table in select clause where the datatype of the column is VARCHAR. Can you please help