Errors when inserting and updating form using VIEW.

Here's my view:
CREATE OR REPLACE FORCE
VIEW  "SH_ADD_EMPLOYEES_VW" ("EMP_ID", "DEPT_ID", "JOB_DESC_ID", "EMPNO", "EMP_FIRST", "EMP_LAST", "USER_NAME", "USER_INI", "DEPTNO", "DEPT_DESC", "ROLES_ID", "ADMIN", "CREATES", "APPROVES", "QUALITY", "CUST_SVC", "SH_LOCAL",
"SH_OFFICE", "SYSTEM")
AS
  select
"SH_EMPLOYEES"."EMP_ID" as "EMP_ID",
"SH_EMPLOYEES"."DEPT_ID" as "DEPT_ID",
"SH_EMPLOYEES"."JOB_DESC_ID" as "JOB_DESC_ID",
"SH_EMPLOYEES"."EMPNO"  as "EMPNO",
"SH_EMPLOYEES"."EMP_FIRST" as "EMP_FIRST",
"SH_EMPLOYEES"."EMP_LAST" as "EMP_LAST",
"SH_EMPLOYEES"."USER_NAME" as "USER_NAME",
"SH_EMPLOYEES"."USER_INI" as "USER_INI",
"SH_EMPLOYEES"."DEPTNO" as "DEPTNO",
"SH_EMPLOYEES"."DEPT_DESC" as "DEPT_DESC",
"DOC_ROLES"."ROLES_ID" as "ROLES_ID",
"DOC_ROLES"."ADMIN" as "ADMIN",
"DOC_ROLES"."CREATES" as "CREATES",
"DOC_ROLES"."APPROVES" as "APPROVES",
"DOC_ROLES"."QUALITY" as "QUALITY",
"DOC_ROLES"."CUST_SVC" as "CUST_SVC",
"DOC_ROLES"."SH_LOCAL" as "SH_LOCAL",
"DOC_ROLES"."SH_OFFICE" as "SH_OFFICE",
"DOC_ROLES"."SYSTEM" as "SYSTEM"
FROM "SH_EMPLOYEES" "SH_EMPLOYEES", "DOC_ROLES" "DOC_ROLES"
where "SH_EMPLOYEES"."EMP_ID" = "DOC_ROLES"."EMP_ID"
Here's my trigger (note - I am not using the EXCEPTION clause or (declaration of it)  because it throws an error on msg=>: 'This is my message.' Any help here would be great as well.)
CREATE OR REPLACE TRIGGER bi_ADD_EMPLOYEES_VW
INSTEAD OF insert ON SH_ADD_EMPLOYEES_vw
for each row
declare
duplicate_info EXCEPTION;
PRAGMA EXCEPTION_INIT(duplicate_info, -00001);
begin
insert into SH_EMPLOYEES
(EMP_ID, DEPT_ID, JOB_DESC_ID, EMPNO, EMP_FIRST, EMP_LAST, USER_NAME, USER_INI, DEPTNO, DEPT_DESC)
values
(:new.EMP_ID, :new.DEPT_ID, :new.JOB_DESC_ID, :new.EMPNO, :new.EMP_FIRST, :new.EMP_LAST, :new.USER_NAME, :new.USER_INI, :new.DEPTNO, :new.DEPT_DESC);
insert into DOC_ROLES
(ROLES_ID, ADMIN, CREATES, APPROVES, QUALITY, CUST_SVC, SH_LOCAL, SH_OFFICE, SYSTEM)
VALUES (
:new.ROLES_ID, :new.ADMIN, :new.CREATES, :new.APPROVES, :new.QUALITY, :new.CUST_SVC, :new.SH_LOCAL, :new.SH_OFFICE, :new.SYSTEM);
EXCEPTION
WHEN duplicate_info THEN
  RAISE_APPLICATION_ERROR (
   num=> -20107
   msg=> 'Duplicate employee');
END bi_ADD_EMPLOYEES_VW;
ERROR ON UPDATE:
ORA-20505: Error in DML: p_rowid=1001,
p_alt_rowid=EMP_ID, p_rowid2=2, p_alt_rowid2=ROLES_ID. ORA-01779: cannot modify
a column which maps to a non key-preserved table
ERROR ON INSERT:
ORA-01400: cannot insert NULL into
("SPICE_HUNTER1"."SH_EMPLOYEES"."EMP_ID") ORA-06512: at
"SPICE_HUNTER1.BI_SH_ADD_EMPLOYEES_VW", line 3 ORA-04088: error during execution
of trigger 'SPICE_HUNTER1.BI_SH_ADD_EMPLOYEES_VW' ORA-06512: at
"SYS.WWV_DBMS_SQL", line 549 ORA-06512: at "APEX_040000.WWV_FLOW_DML", line 1121
ORA-22816: unsupported feature with RETURNING clause
Error Unable to process row on table SH_ADD_EMPLOYEES_VW

From what I see you are not handling emp_id when it is null.. you need to assign it a value when null from sequence.. that column cannot be null, hence the error, and in order to "modify" a column in that table the DML needs that id to have a value.

Similar Messages

  • Multiple rows insert and update form example

    I just want to share with you an example of a multiple rows insert and update form. You can access it HERE (http://tryapexnow.com/apex/f?p=12090:21)
    You will find on the same page the complete description of all elements used to buid it.
    I'm waiting for opinions, suggestions, and questions here in this thread.
    Thanks

    Hello Valentin,
    I got an error message when I clicked on the weblink. Here is the message
    Error ERR-7620 Could not determine workspace for application. Could you please take a look at this.
    Thanks,
    Karol

  • Error when inserting a Record Form

    Hi,
    I'm very green with web development and am just trying my hand at PHP. I've set up a database with Mysql and phpmyadmin  those are working fine.
    I had inserted a record form using the record insertion form wizard and it worked just fine. I deleted it because I wanted some different information and
    now every time I try to insert a new form this error message comes up.
    While executing onClick in ServerObject-InsRecPHP.htm, the following JavaScript error(s) occurred:
    At line 5694 of file 'C:\Program Files (x86)Adobe\Adobe Dreamweaver CS5\Configuration\Shared\Common\Scripts\dwscriptsExtData.js':this.node has no
    properties.
    I've gone to look at the file but I'm not sure how to tell if the properties are working or not. I've also googled this problem but haven't found someone with exactly my dilemma. Any help will be greatly appreciated!
    Thank you for your time

    Troubleshooting JavaScript errors in Dreamweaver
    http://kb2.adobe.com/cps/405/kb405604.html
    Try #4 and #12 first.

  • How to avoid mutating error when insert or update record

    Hi ,
    I have one transaction table which is having some detail record under one transaction number, after the one transaction number is over by insert or update, i
    want to check the total amounts of one flag should be matched on same table if it is not then give error message. But i am getting mutating error on insert or update event trigger on statement level trigger on above table.
    Is there any other way to avoid mutating error to solve the above problem or some temp table concepts to be used. help me its urgent.
    Thanks in advance,
    Sachin Khaladkar
    Pune

    Sachin, here's as short of an example as I could come up with on the fly. The sample data is ficticious and for example only.
    Let's say I need to keep a table of items by category and my business rule states that the items in the table within each category must total to 100% at all times. So I want to insert rows and then make sure any category added sums to 100% or I will rollback the transation. I can't sum the rows in a row-level trigger because I'd have to query the table and it is mutating (in the middle of being changed by a transaction). Even if I could query it while it is mutating, there may be multiple rows in a category with not all yet inserted, so checking the sum after each row is not useful.
    So here I will create;
    1. the item table
    2. a package to hold my record collection (associative array) for the trigger code (the category is used as a key to the array; if I insert 3 rows for a given category, I only need to sum that category once, right?
    3. a before statement trigger to initialize the record collection (since package variables hang around for the entire database session, I need to clear the array before the start of every DML (INSERT in this case) statement against the item table)
    4. a before row trigger to collect categories being inserted
    5. an after statement trigger to validate my business rule
    I then insert some sample data so you can see how it works. Let me know if you have any questions about this.
    SQL> CREATE TABLE item_t
      2   (category  NUMBER(2)   NOT NULL
      3   ,item_code VARCHAR2(2) NOT NULL
      4   ,pct       NUMBER(3,2) NOT NULL);
    Table created.
    SQL>
    SQL> CREATE OR REPLACE PACKAGE trg_pkg IS
      2    TYPE t_item_typ IS TABLE OF item_t.category%TYPE
      3      INDEX BY PLS_INTEGER;
      4    t_item       t_item_typ;
      5    t_empty_item t_item_typ;
      6  END trg_pkg;
      7  /
    Package created.
    SQL> SHOW ERRORS;
    No errors.
    SQL>
    SQL> CREATE OR REPLACE TRIGGER item_bs_trg
      2    BEFORE INSERT
      3    ON item_t
      4  BEGIN
      5    DBMS_OUTPUT.put_line('Initializing...');
      6    trg_pkg.t_item := trg_pkg.t_empty_item;
      7  END item_bs_trg;
      8  /
    Trigger created.
    SQL> SHOW ERRORS;
    No errors.
    SQL>
    SQL> CREATE OR REPLACE TRIGGER item_br_trg
      2    BEFORE INSERT
      3    ON item_t
      4    FOR EACH ROW
      5  BEGIN
      6    trg_pkg.t_item(:NEW.category) := :NEW.category;
      7    DBMS_OUTPUT.put_line('Inserted Item for Category: '||:NEW.category);
      8  END item_br_trg;
      9  /
    Trigger created.
    SQL> SHOW ERRORS;
    No errors.
    SQL>
    SQL> CREATE OR REPLACE TRIGGER item_as_trg
      2    AFTER INSERT
      3    ON item_t
      4  DECLARE
      5    CURSOR c_item (cp_category item_t.category%TYPE) IS
      6      SELECT SUM(pct) pct
      7        FROM item_t
      8       WHERE category = cp_category;
      9  BEGIN
    10    DBMS_OUTPUT.put_line('Verifying...');
    11    FOR i IN trg_pkg.t_item.FIRST..trg_pkg.t_item.LAST LOOP
    12      DBMS_OUTPUT.put_line('Checking Category: '||trg_pkg.t_item(i));
    13      FOR rec IN c_item(trg_pkg.t_item(i)) LOOP
    14        IF rec.pct != 1 THEN
    15          RAISE_APPLICATION_ERROR(-20001,'Category '||trg_pkg.t_item(i)||' total = '||rec.pct);
    16        END IF;
    17      END LOOP;
    18    END LOOP;
    19  END item_as_trg;
    20  /
    Trigger created.
    SQL> SHOW ERRORS;
    No errors.
    SQL> INSERT INTO item_t
      2    SELECT 1, 'AA', .3 FROM DUAL
      3    UNION ALL
      4    SELECT 2, 'AB', .6 FROM DUAL
      5    UNION ALL
      6    SELECT 1, 'AC', .2 FROM DUAL
      7    UNION ALL
      8    SELECT 3, 'AA',  1 FROM DUAL
      9    UNION ALL
    10    SELECT 1, 'AA', .5 FROM DUAL
    11    UNION ALL
    12    SELECT 2, 'AB', .4 FROM DUAL;
    Initializing...
    Inserted Item for Category: 1
    Inserted Item for Category: 2
    Inserted Item for Category: 1
    Inserted Item for Category: 3
    Inserted Item for Category: 1
    Inserted Item for Category: 2
    Verifying...
    Checking Category: 1
    Checking Category: 2
    Checking Category: 3
    6 rows created.
    SQL>
    SQL> SELECT * FROM item_t ORDER BY category, item_code, pct;
      CATEGORY IT        PCT
             1 AA         .3
             1 AA         .5
             1 AC         .2
             2 AB         .4
             2 AB         .6
             3 AA          1
    6 rows selected.
    SQL>
    SQL> INSERT INTO item_t
      2    SELECT 4, 'AB', .5 FROM DUAL
      3    UNION ALL
      4    SELECT 5, 'AC', .2 FROM DUAL
      5    UNION ALL
      6    SELECT 5, 'AA', .5 FROM DUAL
      7    UNION ALL
      8    SELECT 4, 'AB', .5 FROM DUAL
      9    UNION ALL
    10    SELECT 4, 'AC', .4 FROM DUAL;
    Initializing...
    Inserted Item for Category: 4
    Inserted Item for Category: 5
    Inserted Item for Category: 5
    Inserted Item for Category: 4
    Inserted Item for Category: 4
    Verifying...
    Checking Category: 4
    INSERT INTO item_t
    ERROR at line 1:
    ORA-20001: Category 4 total = 1.4
    ORA-06512: at "PNOSKO.ITEM_AS_TRG", line 12
    ORA-04088: error during execution of trigger 'PNOSKO.ITEM_AS_TRG'
    SQL>
    SQL> SELECT * FROM item_t ORDER BY category, item_code, pct;
      CATEGORY IT        PCT
             1 AA         .3
             1 AA         .5
             1 AC         .2
             2 AB         .4
             2 AB         .6
             3 AA          1
    6 rows selected.
    SQL>

  • The error when post a New Form use sap demo news

    Hi all!
    When I post a newform use the SAP Demo News form, I found the text(Title,Date,etc) on the post page is not found.and when I saved,The news text can't display.
    The trace file display:
    #1.5 #00145ED2F356006D0000021D000670C200047D17ADB8AB81#1263440559123#System.err#sap.com/irj#System.err#index_service#275030##DSAPBPRD_DPP_15757350#index_service#dc9235c000be11df9e9600145ed2f356#SAPEngine_Application_Thread[impl:3]_0##0#0#Error##Plain###Exception while loading External XMLSource in 'document': javax.xml.transform.TransformerException: Error downloading from URL: wcm://XFBuilderConfig/Global-ResourceFile__en.xml, Invalid RID: No repository manager found for prefix: /XFBuilderConfig#
    #1.5 #00145ED2F356006D0000021E000670C200047D17ADB8AD1D#1263440559123#System.err#sap.com/irj#System.err#index_service#275030##DSAPBPRD_DPP_15757350#index_service#dc9235c000be11df9e9600145ed2f356#SAPEngine_Application_Thread[impl:3]_0##0#0#Error##Plain###Exception while loading External XMLSource in 'document': javax.xml.transform.TransformerException: Error downloading from URL: wcm://SAP_DemoNews/SAP_DemoNews__en.xml, Invalid RID: No repository manager found for prefix: /SAP_DemoNews#

    Hi.
    Check SAP Note 1007805.
    Best regards,
    Aliaksandr Zhukau

  • Error when ECO and BOM creation using IDoc

    Hi experts,
    now i am doing an interface about ECO/BOM creation and changing using IDoc.The idoc type is ECMMAS02 ans BOMMAT04.
    since i know a little about ECO/BOM, can anyone provide some good materials for me?
    and i don't know which fields are mandatory in idoc segment, so i go to tansaction BD30 to run a BOM changing. i input a change number but the idoc log shows that change number does not exist. what is the change number using? where i can implement the changes, e.g, change the quantity? should the change number be used when creation and changing? how can i get this change number?
    thanks a lot in advance!

    Hi experts,
    now i am doing an interface about ECO/BOM creation and changing using IDoc.The idoc type is ECMMAS02 ans BOMMAT04.
    since i know a little about ECO/BOM, can anyone provide some good materials for me?
    and i don't know which fields are mandatory in idoc segment, so i go to tansaction BD30 to run a BOM changing. i input a change number but the idoc log shows that change number does not exist. what is the change number using? where i can implement the changes, e.g, change the quantity? should the change number be used when creation and changing? how can i get this change number?
    thanks a lot in advance!

  • Error when trying to update Forms & Reports 10g from 10.1.2.0.2 to 10.1.2.2

    Hi,
    I have successfully installed Oracle Application Server 10g Forms & Reports Services 10.1.2.0.2, however when I try to apply the patchset 10.1.2.2 to the only Oracle HOME on the server (FRHOME_1), I receive the following error message:
    *"Invalid staging area. There are no top level components for Windows NT, Windows 2000 available for installation in this staging area"*
    I have installed the above on a Windows Server 2008 system with no problems (using compatibility mode), however I cannot seem to be able to apply the patchset - I can bring up the Oracle Universal Installer, but as soon as I try to patch my Oracle home receive the above error message.
    Has anyone encountered this/a similar problem before?
    Many thanks,
    Chris

    I think this could be a problem of your media, is it a CD or you copied the contents into the harddrive? Check that the size of the CD it's ok, is reable or if it's copied in hard drive, check that the size is the appropieated and all the files are accesible to your user.
    Greetings.

  • Error when inserting Web Dynpro script in Adobe form

    Hi
    In my WD component in one of the view I have an ADOBE form (Online scenario) and a button to save data into backend. In the ADOBE form everything is working properly, however the problem is when I click on the button to save, Its not getting into my action code. Even I am not getting any error other than the wait symbol.
    In the form I have taken ZCI layout but when i'm inserting Webdynpro Script its showing an error 'Error when inserting Web Dynpro script'.
    Please let me know why this error is getting.
    Thanks
    Ram

    Hi Ram,
    I hope  you help me,
    I have the same error, when I insert a web Dynrp Script, what version of SAPGUI do you use?
    Thanks

  • Can we use both INSERT and UPDATE at the same time in JDBC Receiver

    Hi All,
    I would like to know is it possible to use both INSERT and UPDATE at the same time in one interface because I have a requirement in which I have to perform both the task.
    user send the file which contains both new and old record and I need to save those in MS SQL database.
    If the record exist then use UPDATE otherwise use INSERT.
    I looked on sdn but didn't find any blog which perform both the things at the same time.
    Interface Requirement
    FILE -
    > PI -
    > JDBC(INSERT & UPDATE)
    I am thinking to use JDBC Lookup but not sure if it good to use for bulk record.
    Can somebody please suggest me something or send me the link of any blog or anything to solve this problem.
    Thanks,

    Hi ,
              If I have understood properly the scenario properly,you are not performing insert and update together. As you posted
    "If the record exist then use UPDATE otherwise use INSERT."
    Thus you are performing either an insert or an update which depends on outcome of a search if the records already exist in database or not. Obviously to search the tables you need " select * from ...  where ...." query. If your query returns some results you proceed with update since this means there are some old records already in database. If your query returns no rows  you proceed with "insert into tablename....." since there are no old records present in database.
      Now perhaps the best method to do the searching, taking a decision to insert or update, and finally insert or update operation is to be done by a stored procedure in MS SQL database.  A stored procedure is a subroutine available to applications accessing a relational database system. Here the application is PI server.   If you need further help on how to write and call stored procedure in MS SQL you can look into these links
    http://www.daniweb.com/web-development/databases/ms-sql/threads/146829
    http://www.sqlteam.com/article/stored-procedures-parameters-inserts-and-updates
    [ This part you can ignore, Since its not sure that you will face this situation
        Still you might face some problems while your scenario runs. Lets consider this scenario, after the stored procedure searches the database it found no rows. Thus you proceed with an insert operation. If your database table is being accessed by multiple applications (or users) other than yours then it is very well possible that after the search operation completed with a null result, an insert/update operation has been performed by some other application with the same primary key. Now when you are trying to insert another row with same primary key you get an error message like "duplicate entry not possible for same primary key value". Thus you need to be careful in this respect. MS SQL has a feature called "exclusive locks ". Look into these links for more details on the subject
    http://msdn.microsoft.com/en-us/library/aa213039(v=sql.80).aspx
    http://www.mssqlcity.com/Articles/Adm/SQL70Locks.htm
    http://www.faqs.org/docs/ppbook/r27479.htm
    http://msdn.microsoft.com/en-US/library/ms187373.aspx
    http://msdn.microsoft.com/en-US/library/ms173763.aspx
    http://msdn.microsoft.com/en-us/library/e7z8d5hf(v=vs.80).aspx
    http://mssqlserver.wordpress.com/2006/11/08/locks-in-sql/
    http://www.mollerus.net/tom/blog/2008/03/using_mssqls_nolock_for_faster_queries.html
        There must be other methods to avoid this problem. But the point is you need to be sure that all access to database for insert/update operations are isolated.
    regards
    Anupam

  • Oracle forms 10g,multiple insert and update problem

    Hi,
    I have tabular form(4 records displayed) with one datablock(based on a view).
    After querying the form could not update all the records but only first record value can select from LOV.
    I called a procedure in in-insert and on-update
    The query is lik this
    PACKAGE BODY MAPPING IS
         PROCEDURE INSERT_ROW(EVENT_NAME IN VARCHAR2)
         IS
         BEGIN
              IF (EVENT_NAME = 'ON-INSERT') THEN
                   INSERT INTO XX_REC_MAPPING
                   (BRANCH_CODE,COLLECTION_ID,PAY_MODE_ID,RECEIPT_METHOD,CREATED_BY,
                   CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN)
                   VALUES
                   (     :XX_REC_MAPPING.OFFICE_CODE,
                        :XX_REC_MAPPING.COLLECTION_ID,
                        :XX_REC_MAPPING.PAY_MODE_ID,
                        :XX_REC_MAPPING.RECEIPT_METHOD,
                        :XX_REC_MAPPING.CREATED_BY,
                        :XX_REC_MAPPING.CREATION_DATE,
                        :XX_REC_MAPPING.LAST_UPDATED_BY,
                        :XX_REC_MAPPING.LAST_UPDATE_DATE,
                        :XX_REC_MAPPING.LAST_UPDATE_LOGIN);     
              ELSIF (EVENT_NAME = 'ON-UPDATE') THEN          
              UPDATE     XX_REC_MAPPING
              SET BRANCH_CODE=:XX_REC_MAPPING.OFFICE_CODE,
                        COLLECTION_ID=:XX_REC_MAPPING.COLLECTION_ID,
                        PAY_MODE_ID=:XX_REC_MAPPING.PAY_MODE_ID,
                        RECEIPT_METHOD=:XX_REC_MAPPING.RECEIPT_METHOD,
                        LAST_UPDATED_BY=:XX_REC_MAPPING.LAST_UPDATED_BY,
                        LAST_UPDATE_DATE=:XX_REC_MAPPING.LAST_UPDATE_DATE,
                        LAST_UPDATE_LOGIN=:XX_REC_MAPPING.LAST_UPDATE_LOGIN
                        WHERE ROWID=:XX_REC_MAPPING.ROW_ID;
              END IF;
         END INSERT_ROW;
    END MAPPING;
    Whether the table gets looked or sholud i use some other trigger or loops ?
    someone suggest me how to edit this query for multiple update.
    Thanks
    sat33

    I called a procedure in in-insert and on-updateWhy are you writing this code in the first place? If you have a block based on an updatable view, just let Forms do the inserts and updates.
    If it's not an updatable view, use instead of triggers on the view.
    See this current thread too:
    INSTEAD of Trigger View for an Oracle EBS New form development

  • Add fields to maintenance view and update then using events

    Hi experts:
      I've created a table with 4 fields, one of them is userid. Also, there is a maintenance view to add new entries.
      I want to display user name when typing userid using events (1 or 21). I know how to do it if username is one of the fields of the table, but there is a requirement to not store username in the table, just userid.
    My question is: is possible to add a field into the maintenance view and update it using events but not store the value in DB?.
    Thanks in advance for your help.
    Regards,
    Carlos.

    In the save event just clear the entries of the field(user name) in the internal table.

  • Error when I preview my form in HTML using Adobe Livecycle Es4

    Need help!!!! This is the error while I preview my form using HTML. Even though the from structure is present I am not able to preview my form.
    Please reply since it is a project deliverable and its an urgent requirement.
    Thanks in advance.

    I am not able to send the error.log file since its very huge. I have attached the screen shot of the error I am getting when i try to preview the HTMl.
    Can u please give your mail id so that I can send the error.log file.
    Since it is very urgent, require help.

  • I keep getting an error when trying to update an app- cannot connect to store. I logged out from my account and tried to log back in and got the same error. I am doing all this from my phone since I no longer own a personal computer (only work)

    I keep getting an error when trying to update an app- cannot connect to store. I logged out from my account and tried to log back in and got the same error. I am doing all this from my phone since I no longer own a personal computer (only work) since I use iCloud and I tunes match

    YAY!!! Saved it in my Mac's Firefox Bookmarks for easy future access!
    Hope you are having a lovely afternoon today! I'm about ready to go bobo....I have an early meeting, and I don't want to oversleep! The nice part is that I work remotely, so I only have to wake up 15 minutes or so before the meeting.... I don't even use an alarm clock anymore (really, my iPhone alarm, which is much more pleasant), unless I have to get up at 6:30 or something....
    TMI?
    GB

  • Inserting and Updating records in ORACLE using WebDynpro Java

    Hi All
    I got connected to oracle backend (using my previous thread), but now i want to insert and update the records
    i have created views  for insert and update,
    Thanks in advance
    Sushma

    Hi shusma..
    chk this link..
    <b><u>Creating Connection</u></b>
    package com.sap.xirig;
    import javax.naming.*;
    import javax.sql.*;
    import java.sql.*;
    public class DBLookup {
    String Conn_Status = "Not Connected";
    String Language_Desc = "Empty";
    String Language_Cd = "Empty";
    Connection conn;
    Context ctx;
    DataSource ds;
    //Constructor for the DBLookup object
    public DBLookup {
    try {
    ctx = new InitialContext();
    if (ctx == null) {
    throw new Exception("Boom - No Context");
    // If JDBC 2.0 connection is used please create the DataSource object as below
    // ds = (DataSource) ctx.lookup("jdbc/ORACLEDATASOURCE");
    // If JDBC 1.0 connection is used please create the DataSource object as below
    // ds = (DataSource) ctx.lookup("jdbc/notx/ORACLEDATASOURCE");
    if (ds == null) {
    throw new Exception("Boom - No dataSource");
    catch (Exception e) {
    e.printStackTrace();
    public String getLanguageDesc(String v_str) {
    Statement stmt = null;
    ResultSet rst = null;
    try {
    if (ds != null) {
    conn = ds.getConnection();
    Conn_Status = "Could not get connection to
    datasource";
    if (conn != null) {
    Conn_Status = "Got Connection " +
    conn.toString();
    stmt = conn.createStatement();
    rst = stmt.executeQuery("SELECT
    LANGUAGE_DESC FROM LANGUAGETRANSLATION WHERE LANGUAGE_CD='" + v_str +
    if (rst.next()) {
    Language_Desc = rst.getString(1);
    conn.close();
    catch (Exception e) {
    e.printStackTrace();
    finally {
    if (rst != null) {
    try {
    rst.close();
    catch (Exception e) {
    e.printStackTrace();
    if (stmt != null) {
    try {
    stmt.close();
    catch (Exception e) {
    e.printStackTrace();
    if (conn != null) {
    try {
    conn.close();
    catch (Exception e) {
    e.printStackTrace();
    return Language_Desc;
    http://e-docs.bea.com/wls/docs81/oracle/API_joci.html
    Hope this will help u..
    URs GS

  • When restoring and updating my iPhone I am getting the following message " iTunes could not update to the carrier settings for your iPhone.an unknown error occurred (1630)

    When restoring and updating my iPhone I am getting the following message " iTunes could not update to the carrier settings for your iPhone.an unknown error occurred (1630).can anyone please with a knowledge tell me what I should do please. Thank you

    The search bar can be very valuable...........
    In using it, I found out other's have had this issue and it likely means you have a 3G iPad?  If you do, go into settings and turn off cellular data, then try to update again and you should be OK........

Maybe you are looking for

  • Re-size Hierarchy column in ALV Tree

    Hi all, I have created a class inheriting from CL_GUI_ALV_TREE that is used to create a Tree structure for Equipment..... Now my requirement is that the Hierarchy column should be re-sized based on the width of the node text. Please help. Thanks in a

  • ITunes stopped working? ITunes closes. win8 64bit

    Hi, Just got a new Dell XPS Windows 8 64bit. Installed iTunes. Ran it for the first time; tried to connect to the iTunes Store and got an error: "iTunes Stopped Working". Application closes. I have tried reinstalling; same issue. Can you help please?

  • 11.3 crashes after starting

    Every time I start iTunes 11.3 x64, it crashes after the UI appears with a message 'iTunes has stopped working.' Closing the program is my only option. I notice that it is about 60% through "Gathering information about your iTunes library..." for Gen

  • Download from iTune store gets disrupted

    Hi, I got this problem while downloading. Its like whenever i pause my downloads or my cable internet connection gets disconnected, then the download starts from the beginning again ie from ZERO. I had read somewhere the download should have continue

  • ITunes and Safari crashing

    Every time I open Safari or iTunes, I get the message "the application __ has unexpectedly quit. The system and other applications have not been affected." I have tried all of the suggestions in Dr Smoke's article, with the exception of going through