Execute A select statement under Oracle connection?

Hi,
How can i execute a select statement
under an existing Oracle connecton without
defining extera JDBC connection.

Be aware that you can create View Objects that are NOT based on entity objects. In this case, they are read only, but if you just want to display results, or check for a specific value, it at least reduces the overhead of an EO.
I'm not sure that answers the question here, but thought I would at least throw it out there.
In the View Object wizard, on the page that asks you to choose an EO, just click Next without selecting any EOs. This will automatically put you in expert query mode. Just type in your query and go.
You do have to be a little careful with expert mode queries, especially if you go back and edit them later. You need to make sure to keep the attribute mapping in synch on the Attribute page.
Also, I have found some limitations to this approach, which I'm not sure are fixed in 3.2. Namely, you can't use setWhereClause() to set the entire where clause string from the client. You have to use setWhereClauseParams(). This means that you have to have the basic where clause included in the query and user parameters as placeholders for the where clause values. These are JSP methods, I'm not sure what the equivalent is in DAC, but I am pretty sure the same limitation is there.

Similar Messages

  • How to execute a SELECT statement  in java??

    Hello !!
    In my java program , i need to delete a record of number X, so
    i accept the number X from the keyboard
    Then before deleting it
    i want the program to show me the name, age of the record which has the number X
    How to do this

    hello kylas
    actually i didnt get why this program example?? wats
    its executing ??? Look at reply #3 in your other thread:
    http://forum.java.sun.com/thread.jspa?threadID=713289&messageID=4126346
    Notice the similarity? You've now asked "How to delete a record in Java" and "how to execute a select statement in java". You may have noticed that, aside from the SQL and the call to execute and executeUpdate (for delete) it's the same code. This is because you don't so much do these things in Java, you do them in SQL. The Java code simply asks the Driver to execute whatever SQL you write. So, I really hope your next post isn't "how do I execute an UPDATE statement in Java".
    Good Luck
    Lee

  • Convert sql select statement to oracle

    Hi All,
    Can anyone help me converting this Sql select statement to oracle ....
    -----------------------------------------Query--------------------------------------------------------------
    select emp_master.emp_code ,
    emp_master.dept_cd ,
    attendance_master.daily_attn_code ,
    attendance_master.linked_column ,
    case when location.payroll_status <> 'N' and eDocsNetEmployeesLeave.StartDate < dateadd(mm, 1 , convert(smalldatetime, datename(yy ,location.next_pay_date) + '/'+ datename(mm ,location.next_pay_date)+ '/01'))     
    then
    dateadd(mm, 1 , convert(smalldatetime, datename(yy ,location.next_pay_date) + '/'+ datename(mm ,location.next_pay_date)+ '/01'))
    when eDocsNetEmployeesLeave.StartDate < convert(smalldatetime, datename(yy ,location.next_pay_date) + '/'+ datename(mm ,location.next_pay_date)+ '/01')     
    then convert(smalldatetime, datename(yy ,location.next_pay_date) + '/'+ datename(mm ,location.next_pay_date)+ '/01') else eDocsNetEmployeesLeaveDetails.StartDate           
    end ,
    eDocsNetEmployeesLeaveDetails.NoOfDays,          
    case when eDocsNetEmployeesLeave.StartDate > location.next_pay_date     
    then convert(datetime , convert(varchar, dateadd(ss,-1, dateadd(mm, 1, convert(datetime , datename(yy,eDocsNetEmployeesLeave.StartDate)+ '/' + datename(mm,eDocsNetEmployeesLeave.StartDate)+ '/01') )),106) )     
    else      
    case when location.payroll_status <> 'N'
    then dateadd(mm,1,location.next_pay_date)      
    else location.next_pay_date
    end      
    end as PaymentDate               ,
    isnull(grade_master.leave_type,'C') ,
    eDocsNetEmployeesLeave.StartDate ,          
    eDocsNetEmployeesLeaveDetails.LeaveType
    from eDocsNetEmployeesLeave ,
    eDocsNetEmployeesLeaveDetails ,
    eDocsNetLeaveTypes ,
    emp_master ,
    grade_master ,
    attendance_master ,
    location
    where eDocsNetEmployeesLeaveDetails.RequestID     = eDocsNetEmployeesLeave.RequestID and
    eDocsNetEmployeesLeave.EmployeeID = emp_master.emp_code and
    eDocsNetEmployeesLeaveDetails.LeaveType = eDocsNetLeaveTypes.LeaveTypeID and
    eDocsNetLeaveTypes.loc_cd = emp_master.loc_cd and
    location.loc_cd = emp_master.loc_cd and
    attendance_master.loc_cd = emp_master.loc_cd and
    attendance_master.linked_column = eDocsNetLeaveTypes.LinkedAttendance and
    grade_master.loc_cd = emp_master.loc_cd and
    grade_master.grade_cd = emp_master.grade_cd and
    eDocsNetEmployeesLeaveDetails.RequestID      = @RequestID
    order by eDocsNetEmployeesLeaveDetails.StartDate
    Thanks in Advance
    Smiley

    Seems like you want to convert a SQL statement from the ??? dialect to the Oracle dialect. *(It would be useful to indicate the non-ANSI standard SQL you are starting with.)
    Part of the problem is that you use several date related functions. Some are unnecessary in Oracle and some need to translated into Oracle functions as found in the Functions section (chapter 5) of the SQL Reference manual at http://www.oracle.com/pls/db102/homepage
    Note that columns and expressions of type 'date' in ORacle always contain all of "yyyy mm dd hh mi ss" and you need to format and trauncate as necessary.
    Also note that '09-JAN-31' is NOT an Oracle date, but rather a character representation of a date which must be converted to/from a date expression. You will often need to use the to_date() and to_char() functions with a format mask as the second parameter. This is also descreibed in the first 2 chapters of the SQL Reference manual.

  • Oracle Error while execute the Select statement

    Hi all,
    I have two database, from one databse to another datadase, i am not able get value. while i am generating the select statement in one database, it throws an
    error ORA-00942: table or view does not exist.
    For this, what i have to do.can anyone post more detail on this.
    Any idea?

    Please do not create duplicate threads.
    ORA-00942: table or view does not exist

  • How to execute a select statement in unix shell script

    Hi,
    How to execute the below statement in unix shell .
    select count( ID) into v_count from tbl_data1
    where ID =V_ID;
    thanks
    BCJ

    Thanks for the reply.
    few more doubts,
    the V_ID value is a user input getting inside the unix script, so how can i pass the value in to the a.sql.
    also needs the v_count value inside the unix script for further process.actual requirement is like,
    declare
    v_count number;
    begin
    select count( ID) into v_count from tbl_data1
    where ID =$V_ID;
    if v_count>1 then
    process 1;
    else
    process2;
    end if;
    end;
    thanks a lot

  • Getting error while executing this select statement

    Hi All,
    I am new to this community.
    I am getting error whie compiling the below code. Its telling 'Text' is invalid identifier. Also i want to know how can we obtain 'parseable' version of the below query?
    my basic intention is to create a trigger header through a select statement and show it the complete text as a single column..
    select text from
    (select 'CREATE OR REPLACE TRIGGER '||SUBSTR(column_name,2,4)||'aud
    AFTER INSERT
    OR UPDATE
    OF '||column_name||',
    OR DELETE ON '||table_name||'
    FOR EACH ROW'
    FROM(SELECT lower(REPLACE(column_name,'O_','')) column_name , /*changing O to O_*/
    lower(replace(t.table_name,'_A_','_')) table_name,
    lower(t.table_name) table_name1,
    c.column_id
    FROM all_tab_columns c,
    (SELECT object_name table_name
    FROM all_objects
    WHERE object_name LIKE '%/_A/_%' ESCAPE '/') t
    WHERE c.table_name(+) = t.table_name
    AND SUBSTR(column_name(+),1,2) = 'O_'))

    thanks prathamesh. it solved the problem. i have one more question.
    as of now it creates single create trigger statement for each column on a table.
    example:
    CREATE OR REPLACE TRIGGER ust_aud
    AFTER INSERT
    OR UPDATE
    OF cust_id,
    OR DELETE ON characteristic_t
    FOR EACH ROW
    however, i want to create trigger for all columns in a single statement. can you please help me how to do it?
    basically want to 'CREATE TRIGGER' for all columns in a table. i am finding difficult how to change my query to suit this!!
    i am pasting my original query again for your reference. pls advise...
    example:
    CREATE OR REPLACE TRIGGER ust_aud
    AFTER INSERT
    OR UPDATE
    OF cust_id,
    fixed_item_val,
    copy_item_val,
    rgn_id,
    txn_id,
    OR DELETE ON characteristic_t
    FOR EACH ROW
    ORIGINAL QUERY
    select text from
    (select 'CREATE OR REPLACE TRIGGER '||SUBSTR(column_name,2,4)||'aud
    AFTER INSERT
    OR UPDATE
    OF '||column_name||',
    OR DELETE ON '||table_name||'
    FOR EACH ROW' text
    FROM(SELECT lower(REPLACE(column_name,'O_','')) column_name , /*changing O to O_*/
    lower(replace(t.table_name,'_A_','_')) table_name,
    lower(t.table_name) table_name1,
    c.column_id
    FROM all_tab_columns c,
    (SELECT object_name table_name
    FROM all_objects
    WHERE object_name LIKE '%/_A/_%' ESCAPE '/') t
    WHERE c.table_name(+) = t.table_name
    AND SUBSTR(column_name(+),1,2) = 'O_'))

  • Exception while executing a select statement.

    Hello All,
    I get an exception:
    "CX_SY_NO_HANDLER triggered
    An exception with the type CX_SY_OPEN_SQL_DB occured but was neither handled"
    Here is the select statement:
    select single empneededby from hrp9007 into start_date
    where OBJID = REQUISITION_NUM .
    Can anybody tell me whats goin on here.
    Thanks
    Srinivas

    Hello Srinivas,
    In ur first post u have assigned OBJID to REQUISITION_NUM
    But now u have changed to reqnr
    select single empneededby from hrp9007 into start_date
    where plvar eq '01'
    and istat eq '1'
    and begda le sy-datum
    and endda ge sy-datum
    and reqnr eq REQUISITION_NUM " Check here
    and status eq '99'.
    IF SY-SUBRC = 0.
    " U r having data for the selection condn in the table.
    ENDIF.
    Regards,
    Vasanth

  • How to execute multiple sql statements in oracle?

    I want to execute multiple statements in a single transaction in oracle. Following are my queries:
    Create table temp_table as Select * from table;
    SELECT * FROM temp_table d;
    drop table temp_table ;
    I am using sql comment text in asp.net
    I am using executenonquery command in asp.net.
    Thanks,
    Divya

    SigCle ,
    Here's an example that executes 3 statements;
    begin insert into foo values(1); insert into foo values(2); insert into foo values(3); end;
    923354,
    The block doesn't compile because temp_table doesn't exist at the point you're trying to compile the anonymous block. I'd recommend re-reading the doc link and forum link provided to get a better understanding of how temp tables work, as it's simply different with Oracle. You don't create Oracle temporary tables on the fly; you create them ahead of time and then just use them. The data itself is already specific to a particular session; you don't create and drop the table each time.
    Also, you can't just "select * from table" in plsql. The results have to GO SOMEWHERE. Usually you'd either open a cursor and process it in the block, or send out a ref cursor if you want to send the data to a client side app. The ref cursor data wouldn't actually be fetched until the block completes though, so you'd need to use ON COMMIT PRESERVE ROWS, which would also mean you'd need to clean up the data yourself (delete the data from the table when you're done with it).
    Corrections/comments welcome.
    Greg

  • Executing multiple insert statement in oracle

    hellor every one,
    I have multiple insert statements which should be executed in a single execution and i placed the sample insert statement here. How can i execute these statement in a single execution. Please help me.
    insert into r_symptom_master_tcs (RSM_CRT_DT,RSM_SYM_CD,RSM_CRT_UID,RSM_SYM_DESC) values('30-Sep-2005',1,'04509','Abdomen pain');\
    insert into r_symptom_master_tcs (RSM_CRT_DT,RSM_SYM_CD,RSM_CRT_UID,RSM_SYM_DESC) values('30-Sep-2005',2,'04509','Abdominal bloating');\
    insert into r_symptom_master_tcs (RSM_CRT_DT,RSM_SYM_CD,RSM_CRT_UID,RSM_SYM_DESC) values('30-Sep-2005',3,'04509','Abdominal cramps');\
    insert into r_symptom_master_tcs (RSM_CRT_DT,RSM_SYM_CD,RSM_CRT_UID,RSM_SYM_DESC) values('30-Sep-2005',4,'04509','Abdominal pain');\
    insert into r_symptom_master_tcs (RSM_CRT_DT,RSM_SYM_CD,RSM_CRT_UID,RSM_SYM_DESC) values('30-Sep-2005',5,'04509','Abdominal sensitivity');\
    insert into r_symptom_master_tcs (RSM_CRT_DT,RSM_SYM_CD,RSM_CRT_UID,RSM_SYM_DESC) values('30-Sep-2005',6,'04509','Abnormal bleeding');\
    insert into r_symptom_master_tcs (RSM_CRT_DT,RSM_SYM_CD,RSM_CRT_UID,RSM_SYM_DESC) values('30-Sep-2005',7,'04509','Abnormal weight gain');\
    insert into r_symptom_master_tcs (RSM_CRT_DT,RSM_SYM_CD,RSM_CRT_UID,RSM_SYM_DESC) values('30-Sep-2005',8,'04509','Abnormal sensitivity to cold');\
    insert into r_symptom_master_tcs (RSM_CRT_DT,RSM_SYM_CD,RSM_CRT_UID,RSM_SYM_DESC) values('30-Sep-2005',9,'04509','Abnormal sensitivity to heat');\
    insert into r_symptom_master_tcs (RSM_CRT_DT,RSM_SYM_CD,RSM_CRT_UID,RSM_SYM_DESC) values('30-Sep-2005',10,'04509','Abnormal movements');\
    insert into r_symptom_master_tcs (RSM_CRT_DT,RSM_SYM_CD,RSM_CRT_UID,RSM_SYM_DESC) values('30-Sep-2005',11,'04509','Absence of menstrual periods');\
    insert into r_symptom_master_tcs (RSM_CRT_DT,RSM_SYM_CD,RSM_CRT_UID,RSM_SYM_DESC) values('30-Sep-2005',12,'04509','Absence of periods');\
    insert into r_symptom_master_tcs (RSM_CRT_DT,RSM_SYM_CD,RSM_CRT_UID,RSM_SYM_DESC) values('30-Sep-2005',13,'04509','Absent menstrual periods');\

    > but in what editor we should do this, either in the sql editor, or pl/sql
    Whatever editor you are comfortable with. I assume there is one.
    btw if there are a lot of INSERT statements in the script it might be worth adding the following to the top:
    ALTER SESSION SET CURSOR_SHARING = SIMILAR;

  • Output of value returned from function in SELECT statement ??

    Hi
    I have created the below function
    create or replace
    FUNCTION jc_test
    RETURN VARCHAR2
    IS myrec VARCHAR2(270);
    BEGIN
    SELECT RPAD('*',270,'*')
    INTO myrec
    FROM DUAL ;
    RETURN myrec;
    END ;
    and I executed the SELECT statement in Oracle SQL developer as a script
    select
    LENGTH(jc_test()) len
    *,jc_test() rec*
    from dual ;
    I get exact output as below
    LEN REC
    270 ******************************************************************************************************************************************************************************************************************************************************************************
    So here LEN is correctly shown as 270 characters but when I see the astrisk's (also appended with spaces ) its total length is 4000 characters
    Can anyone give their thoughts on this.
    Its fine if I run as normal, i mean not as a script.
    Regards
    jc
    Edited by: JC on Jun 16, 2011 11:25 AM

    Hi,
    So here LEN is correctly shown as 270 charactersYes, correct
    but when I see the astrisk's (also appended with spaces ) its total length is 4000 charactersNo buts. It is not padded. That is just how it is displayed by your tool. In SQL*Plus this is controlled by LINESIZE and COLUMN
    SQL> create or replace function dummy return varchar2 as begin return null; end;
      2  /
    Function created.
    SQL> select dummy from dual;
    D
    X
    SQL> select dummy() from dual;
    DUMMY()
    SQL> col "dummy()" for a10
    SQL> select dummy() from dual;
    DUMMY()
    SQL>P.S: It is a really bad idea to create your own wrapper functions, built-in functions. Hopefully you are not really doing that?
    Regards
    Peter

  • Table or view does not exists error while executing select statement

    Hi,
    I am new to Oracle. I am getting a error while executing the select statement if i give table name without double quotes.
    Ex: Select * from Customer;
    But working fine when the table name is enclosed within a double quotes.
    Ex: Select * from "Customer";
    Is there any way to execute the select statement without the double quotes?
    Actually I am using NHibernate objects for data access.
    Thanks,
    Sai

    Actually I am using NHibernate objects for data access.And probably that's the problem:
    SQL> select * from mytab;
             A
             1
    SQL> select * from mYtAb;
             A
             1
    SQL> select * from MYTAB;
             A
             1
    SQL>  select * from MYTAb;
             A
             1Oracle statements are case insensitive and doesn't require double quotes unless the object names are reserved words.
    As wrote by others if table is created using double quotes it's name bacomes case-sensitive... and this could be the problem...
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/02/05/gestione-degli-errori-in-sql-con-log-errors/]
    Edited by: Massimo Ruocchio on Feb 5, 2010 7:08 PM
    Added last comment..

  • VC & Oracle (Select Statement )

    Dear All
    I have implemented a feedback form in my Portal and the data which the portal gets is saved in oracle database .
    Now my problem is i want to show the Admin of the portal what feed back we got
    So I want to fire a select statement into oracle database but i don't know how to do that.
    Can any one tell me how to get the result of select statement in VC from oracle database
    Regards
    Krishan

    krishan,
    You should define your database in the Portal and give it an alias.
    You will have to use the JDBC connector.
    After doing so you will have to create a stored procedure to select your data from the Oracle DB.
    You will be able to access the oracle DB from the vsual composer by means of Stored procedure.
    Please get back to me if you need more help.
    Regards,
    Ahmed Salah

  • Executing String which  has SELECT statement

    String stmt:='Select * from Table a';
    How do I execute the select statement present in the string.
    Thanks for the help in advance

    In most cases this is something you should not be doing on a regular basis. Also when using dynamic sql, take care to use bind variables.
    SQL> create or replace function f (p_stmt varchar2)
      2  return sys_refcursor as
      3    c sys_refcursor;
      4  begin
      5    open c for p_stmt;
      6    return c;
      7  end;
      8  /
    Function created.
    SQL> var c refcursor
    SQL> exec :c := f('select * from emp')
    PL/SQL procedure successfully completed.
    SQL> print c
    EMPNO ENAME      JOB          MGR HIREDATE     SAL   COMM DEPTNO
      7369 SMITH      CLERK       7902 17-DEC-80    800            20
      7499 ALLEN      SALESMAN    7698 20-FEB-81   1600    300     30
      7521 WARD       SALESMAN    7698 22-FEB-81   1250    500     30
      7566 JONES      MANAGER     7839 02-APR-81   2975            20
      7654 MARTIN     SALESMAN    7698 28-SEP-81   1250   1400     30
      7698 BLAKE      MANAGER     7839 01-MAY-81   2850            30
      7782 CLARK      MANAGER     7839 09-JUN-81   2450            10
      7788 SCOTT      ANALYST     7566 09-DEC-82   3000            20
      7839 KING       PRESIDENT        17-NOV-81   5000            10
      7844 TURNER     SALESMAN    7698 08-SEP-81   1500      0     30
      7876 ADAMS      CLERK       7788 12-JAN-83   1100            20
      7900 JAMES      CLERK       7698 03-DEC-81    950            30
      7902 FORD       ANALYST     7566 03-DEC-81   3000            20
      7934 MILLER     CLERK       7782 23-JAN-82   1300            10
    14 rows selected.
    SQL>Given the example in the question, execute immediate wouldn't work, unless the table only had one row or bulk collect was used.

  • ORA-00911: invalid character using multiple select statements

    I am getting an ORA-00911: invalid character error when trying to execute 2 select statements using ODP.NET.
    cmd.CommandText = "select sysdate from dual;select sysdate from dual;";
    cmd.Connection = conn;
    cmd.CommandType = System.Data.CommandType.Text;
    conn.Open();
    OracleDataReader dr = cmd.ExecuteReader();
    This works in SQL server but for some reason it appears this does not work in Oracle?
    If this is the case what is a vaiable workaround? Wrapping the 2 statements in a transaction?
    Seems strange that you can't return multiple result sets using in-line sql statements.

    Oracle doesn't support passing multiple statements like that, and this is unrelated to ODP.NET.
    SQL> select * from emp;select * from dept;
    select * from emp;select * from dept
    ERROR at line 1:
    ORA-00911: invalid character
    You could do it via an anonymous block and ref cursors though if you dont want to do it via a stored procedure..
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    public class test
    public static void Main()
        using (OracleConnection con = new OracleConnection("data source=orcl;user id=scott;password=tiger;"))
            con.Open();
            string strSql = "begin open :refcur1 for select * from emp;" +
                "open :refcur2 for select * from dept;" +
                "open :refcur3 for select * from salgrade;end;";
            using (OracleCommand cmd = new OracleCommand(strSql, con))
                cmd.Parameters.Add("refcur1", OracleDbType.RefCursor, ParameterDirection.Output);
                cmd.Parameters.Add("refcur2", OracleDbType.RefCursor, ParameterDirection.Output);
                cmd.Parameters.Add("refcur3", OracleDbType.RefCursor, ParameterDirection.Output);
                OracleDataAdapter da = new OracleDataAdapter(cmd);
                DataSet ds = new DataSet();
                da.Fill(ds);
                cmd.Parameters["refcur1"].Dispose();
                cmd.Parameters["refcur2"].Dispose();
                cmd.Parameters["refcur3"].Dispose();
                foreach (DataTable dt in ds.Tables)
                    Console.WriteLine("\nProcessing {0} resultset...", dt.ToString());
                    foreach (DataRow row in dt.Rows)
                        Console.WriteLine("column 1: {0}", row[0]);
    }Hope it helps,
    Greg

  • Auto retry of select statements on failure

    I have a IBM Message Broker message flow that accesses the database to fetch some data. following are the steps in a message flow. (similar pattern is there in other flows as well)
    1) Parse the input message
    2) Invoke a ESQL compute node that accesses the database. This uses DataDirect ODBC drivers to access the database.
    3) process the data
    4) Invoke an external Java class that also accesses the database. This Java class uses Spring/Hibernate and uses the Oracle UCP library.
    Steps 2 and 4 access an Oracle database on which failover features are NOT enabled. Following is our observation.
    If the database fails when executing step 2, then the message flow pauses until a valid connection is available and then proceeds with the execution, the point to note is that the message flow does not experience a failure. It simply pauses until it gets a connection and continues once it gets a connection.
    If the database fails when executing step 4, the message flow gets an error.
    What we want is for step 2 and 4 to execute the same way, meaning that we want the message flows to wait until a valid connection is available and then continue without any errors.
    I feel that there is some feature in DataDirect driver that cause step 2 to pause the message flow and prevent an error. We want the same behaviour in step 4 as well.
    So, is there some way (via configuration or any other means) to get this behaviour using oracle UCP library.
    One thing to note is that we are not in position to change the Java code since it has been developed by a third party.
    To achieve this I have written a test and the following are details.
    For this I have created a service with the following properties. Point to note is that we run the service on only one instance at a time, if it goes down then it is started on the second instance.
    Service name: LDL_TEST02
    Service is enabled
    Server pool: CSAHEDA_LDL_TEST02
    Cardinality: 1
    Disconnect: false
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: true
    Failover type: SELECT
    Failover method: NONE
    TAF failover retries: 180
    TAF failover delay: 5
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: BASIC
    Edition:
    Preferred instances: CSAHEDA1
    Available instances: CSAHEDA2
    Following is in my tnsnames.ora file and I am using the oracle oci driver.
    TESTA =
    (DESCRIPTION =
    (ENABLE = BROKEN)
    (LOAD_BALANCE = off)
    (FAILOVER = on)
         (ADDRESS_LIST =
         (ADDRESS = (PROTOCOL = TCP)(HOST = vip.host1)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = vip.host2)(PORT = 1521)))
    (CONNECT_DATA =
    (SERVICE_NAME = LDL_TEST02)
    (FAILOVER_MODE =
    (BACKUP = TESTA2)
    (TYPE = SELECT)
    (METHOD = PRECONNECT)
    (RETRIES = 120)
    (DELAY = 5)
    This is how I run my test.
    1)I have a simple test that simply loops through a list of select statements.
    2)each time it takes a connection from the connection pool, executes the statement and returns the connection to the connection pool.
    3)I keep this running for around 10 minutes.
    4) once the test has started I bring down the service wait for 3 minutes and the start the service on the second instance.
    5) what I expect is for the test to pause for 3 minutes and then get the correct value from executing the select statement. and continue without pause.
    Following is the config for the connection pool.
         <bean id="dd_Datasource" class="oracle.ucp.jdbc.PoolDataSourceFactory" factory-method="getPoolDataSource">
              <property name="connectionFactoryClassName" value="oracle.jdbc.xa.client.OracleXADataSource"/>
              <!-- property name="connectionFactoryClassName" value="oracle.jdbc.pool.OracleDataSource"/ -->
              <!-- <property name="connectionFactoryClassName" value="sun.jdbc.odbc.ee.DataSource"/-->
              <!-- <property name="URL" value="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host2)(PORT=1521))(LOAD_BALANCE=yes)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=LDL_TEST02)))" /> -->
              <!-- <property name="URL" value="jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host2)(PORT=1521))(LOAD_BALANCE=yes)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=LDL_TEST02)))" />-->
              <!-- property name="URL" value="jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(FAILOVER=on)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host1) (PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host2) (PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=LDL_TEST02)(FAILOVER_MODE = (TYPE = SELECT)(METHOD = BASIC)(RETRIES = 180)(DELAY = 5))))" /-->
              <!-- <property name="URL" value="jdbc:oracle:oci:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS_LIST=(LOAD_BALANCE=on)(FAILOVER=on)(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host1) (PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host2) (PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=LDL_TEST01)(FAILOVER_MODE = (TYPE = SELECT)(METHOD = BASIC)(RETRIES = 180)(DELAY = 5))))" /> -->
              <property name="URL" value="jdbc:oracle:oci:/@TESTA" />
              <!-- JDBC ODBC Bridge Driver -->
              <!-- property name="URL" value="jdbc:odbc:LT_Test_DB"/-->
              <!-- DataDirect URLs -->
              <!-- property name="URL" value="datadirect:oracle://vip.host1:1521;SID=LDL_TEST01"/-->
              <property name="user" value="user" />
              <property name="password" value="user" />     
              <property name="connectionPoolName" value="dd_connectionpool" />
              <property name="minPoolSize" value="2" />
              <property name="maxPoolSize" value="4" />                     
              <property name="initialPoolSize" value="2" />
              <property name="connectionWaitTimeout" value="10000" />
              <!-- Note:
                   The setSQLForValidateConnection property is not recommended when using an Oracle JDBC driver.
                   UCP for JDBC performs an internal ping when using an Oracle JDBC driver.
                   The mechanism is faster than executing an SQL statement and is overridden if this property is set.
                   Instead, set the setValidateConnectionOnBorrow property to true and do not
                   include the setSQLForValidateConnection property. -->
              <property name="validateConnectionOnBorrow" value="true"/>
              <!-- FCF stuff -->
              <!-- property name="connectionCachingEnabled" value="true"/-->
              <!-- property name="fastConnectionFailoverEnabled" value="true"/-->
              <!-- <property name="ONSConfiguration" value="nodes=vip.host1:1521,vip.host2:1521"/>-->
         </bean>     
    As you can see I have tried many combinations.
    Sometimes I see the thread pause for 3 minutes without error and then continue.
    Sometime I start seeing 'oracle.ucp.UniversalConnectionPoolException: Cannot get Connection from Datasource' as soon as the servic is down.
    Sometime the first error above is seen after 30 seconds (always the first one).
    Can you guys shed any light on this? And how can I get the desired behaviour?
    Edited by: user12181209 on 30-May-2012 02:22
    reworded.
    Edited by: user12181209 on May 30, 2012 6:28 AM
    reworded the title for clarity.
    Edited by: user12181209 on Jun 1, 2012 6:01 AM

    Hi,
    Yesterday, a similar question on running slow view was post :
    View is tooo slow....
    You can read different questions to try to help you.
    Nicolas.

Maybe you are looking for

  • How do I use hot spots in the most advanced style?

    My first attempt at Dreamweaver web design.http://www.deer-harbor-stewardship-project.org  . I will be resampling my images and doing a ton of other appropriate modifications but here are some initial questions. How do I use this "plug in" http://mat

  • Using Views to access XML Content

    I was wondering if anyone can help me in these questions. I created a view to access XML Content in the database for reports. My first question is I have 18 properties in the xml document but when I created the view I only retrieve one property infor

  • Premiere Pro CC2014.2 ntdll error

    Hey, anyone else having PP crash after the 8.2 update? I keep getting the below error: Faulting application name: Adobe Premiere Pro.exe, version: 8.2.0.65, time stamp: 0x5486db4a Faulting module name: ntdll.dll, version: 6.1.7601.18247, time stamp:

  • Sandisk 120GB Ultra SATA 3Gb/s 2.5" Solid State Drive for macbook pro

    hi all! has anyone installed this SANDISK 120 GB ULTRA SATA 3GB/S 2.5 INCH SSD in a macbook pro? is it a good SSD? any wise advise will be really helpful. many thanks to all

  • Interactive reporting CreateLimit function

    Im using Interactive reproting 11.1.2.3. In the dashboard section for updating the values for the dropdown list boxes, im reading values from result section and add. Out of 10 dropdown boxes only one was not working. The code i used was function crea