Stopping query in jdbc

We gave basically a data mining application that can do unions over 12 dozen tables. If figures out what joins to do based on the columns being returned and the columns being searched on.
So the user uses the UI in java to specify what data they want and causes the query to be started using jdbc. After 10 minutes of waiting, they still don't have their results and want to cancel the query. The thread is still in jdbc and won't return until the there is data to return.
So how does the java application stop the query? You don't want to let it run another 12 hours, especially if the user is going to do start and abandon a dozen queries.

chk this
http://onjava.com/lpt/a/4938
also this
http://download.oracle.com/javase/1.4.2/docs/api/java/sql/Statement.html#cancel%28%29

Similar Messages

  • Reg: How to Stop Polling of JDBC Adapter without Scheduling the adapter

    Dear Gurus,
    Here I am having one requirement. My clients wants to send data from JDBC adapter (ORcale System table) to R3 system via RFC.
    His Requirement::
    1. He is not telling the time of data flow from Oracle server so that based on that we can schedule the adapter in the Communication Channel monitoring (Availablitiy Time Planning) or Else we can Schedule by deciding the setting of the polling interval time.
    2. He is telling that When ever he waants to send the data he will place one dummy file in the File Adapter FTP location so that it will became an Indication for u to poll the jdbc adapter and to transfer the data to R3.
    3. Untill he keeps the file or gives indication he doesn;t want to communicate with Oracle server due to some security and it s a most important data base he doesn't want to disturb that Oracle Server as so many business are running  on that.....
    We Proposed::
    1. Atleast you need to tell the scheduling time or poll interval time so that we can schedule our adapter.
    but he s not accepting for this
    2. Atleast U need to give access for Data base to enter one more extra field like STATUS CODE so that we will add one number and we keep on Update in the Update table and based on that Update table statement it will poll.
    but he s not even accepting for this
    3. Finally we prposed that to create another table in the Oracle SYstem as Dulplicate Table which is similar to Standard Orginal table when ever he wants to pick the data please keep that data in this Duplicate TABle so that JDBC adapter will pick the data from thsi TABLE instead of picking the data from that standard table so that it will not effect any standard table data in the table.
    but he s not even accepting for this
    We have done some R & D:::
    1. WE approached even through BPM and via switch conditions is one scenario
       FILE RECEIVE >SWITCH CONDITION> RECEIVE AND SEND or else EXIT
    2. Using correlation in anotehr scenario means correlating File adapter and JDBC and based on one dynamica value it will goes to SEND STEP ( RECE IVE --> RECEIVE --> SEND STEPS )
    Even though we know this...concept that...we jsut tried::
    In BPM we can control the flow in XI 3.0 but we cannot Stop the Polling of JDBC adapter at backend because one the data comes from FILE adapter it will keep on HOLD untill it receives the JDBC from Oracle then based on the condition or Correlation it will goes futher SEND step means after that file adapter is picking file or not ...what ever it may be JDBC will polls at backend and brings that data to BPM"
    Hence sugest me How to Stop Polling of JDBC Adapter without Scheduling the adapter or else using STATUS CODE Update statements in JDBC Tables 
    Regards:
    Amar Srinivas Eli

    Hi! All,
    Finally I decided to do the scenario in two steps:
    1: FILE REQ --> JDBC REQ -->JDBC RES --> FILE RECV
    2: FILE RECV --> RFC
    But I am getting issue while doing first scenario
    Desgn :
    I have created 2 Synchronous interfaces :
    1) FILE 2 JDBC REQ
    In this a) out put message is FILE  Req
              b) Input msage:; FILE RES
    2} JDBC2FILE RECV
            a) Output mesage;; JDBC REQ
            b) Input Msge :: JDBC Response
    Mappings:
    1) File REQ-->JDBC REQ
    2) JDBC RES-->FILE RES
    Interface mappings:
    1: FILE 2 JDBC REQ--> JDBC 2 FLE RECV
    CONFIGURATION ::
    1: One Seder File CC
    2: Two reciever CC's one is for JDBC RECEIVER and other s FILE RECEIVER
    3; One Sender Agreement
    4: 2 Recver agreements
    5: One Interface Determination and
    6: One RECCV Determination
    My Question;;
    1. First let confirm whether my development steps are right or not ?
    2: Another thing s I am not sure reg Configuration Steps means
    whetehr one interface determination and one Receiver Determinations are required or not as these are synchronous Interfaces
    3: main Issue is::::
    If my scenario s FILE2RFC2FILE then I will get RFC response automatically but here issue is this is JDBC
    My reqquirement is By sending one Field from fILE to JDBC REQ it needs to send entire TAbLE records as a Response to file as XML
    without having Sender JDBC how can I send the JDBC Res to FILE and If that is the case then again JDBC adapter is polling which is contradict to the client requuirement which i explained above.
    pleas suggest me the Detailed steps mainly Colloboration agreements and logical routings and
    also explain in detail if i can  go for BPM
    Also give cleear blogs but before giving make sure that it contains detailed screen shots because aIready gone thorugh
    Scenario File-JDBC-RFC
    File<-->JDBC Sync coomunication.
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/file-rfc-file(Without+BPM)
    /people/luis.melgar/blog/2008/05/13/synchronous-soap-to-jdbc--end-to-end-walkthrough
    Regards::
    Amar Srinivas Eli

  • Update query in JDBC adapter

    Hi guys help me with this
    1) What is the use of update query in jdbc adapter?
    2) Why do we use the flag field in jdbc table ?

    Hi,
    1) What is the use of update query in jdbc adapter?
    The purpose of the Update Query in JDBC is to change the status of the processed records in the table.
    That is when JDBC query is executed  it select the records from the table in the Database and it sends to the Receiver.
    After that it executes the Update query to change the status of the processed records in the Table.
    2) Why do we use the flag field in jdbc table ?
    Flag field in the table is used to identify which record is processed by Jdbc adapter. Initial stage it will have the status as 0 , if it is successfully processed then it will updated to 1.
    Based on this we can identify processed records which is done by update query.
    Regards
    Sridhar Goli

  • Mail stopped querying other email address'

    without having changed anything (that I know of) my mail program suddenly stopped querying my home email server. I travel often between two states and have two internet companies and two email addresses which both always send email to my mac mail program with out any problem for months. suddenly yesterday it only feceived email for local server.
    i checked preferences, addresses still there, called internet companies, they said they weren't reporting any issues... any ideas? i can still go to a site online and grab this email but it is obviously more convienent to get your mail when you click mail! thanks~
    mail is 1.3.11, powerbook g4, OS 10.3.9

    thank you

  • How to use unload query using JDBC with Informix database

    Hi friends,
    How can i use unload query using JDBC with Informix database?
    When i use it as "unload to 'abc.txt' select * from ........" it gives syntax error.I want to take the data of a table to a file.With dbaccess i can use it but i need to do it using jdbc.
    Thanks,
    Raneesh.

    To the best of my ability to tell, the right way to use this product from within Power Query would be to use its API. Unfortunately, we don't currently support either of the methods needed to be able to authenticate with the service (OAuth 2.0 and a relatively-custom
    digest-based method). Adding a mechanism to allow use of arbitrary OAuth-protected resources is a fairly high priority for us, and I hope we'll be able to deliver something before mid-2015.
    Scraping the website is very hard to do well -- both from an authentication and from a data discovery perspective.

  • Executing Select query using JDBC Receiver Adapter

    I created couple types in Oracle and also new function instead of procedure
    Can I execute the above query using JDBC Receiver Adapter.
    select *
    from  the ( select cast( apr.get_distribut('', '', '', 'hdfcgd', 'CAN') as dsrTable )
             from dual );
    If possible how my message structure should look like...

    Hi vikram,
       If you use JDBC as Receiver Adapter you can only post the data to the data base I do no think so we can select the records from the data base.
       If you use JDBC as Sender hope,we can the select query in the sender communication channel.
        Hope I am clear.
      Thanks and Regardds,
      Chandu.

  • Handling any query using JDBC ?

    Hi there,
    I was wondering if their actually exist a way of handling/processing any SELECT statement a user would enter.
    ex: the user enter SELECT * FROM SCOTT.EMP;
    Is it possible to retrieve using JDBC teh metadata associated with "*" ?
    any help would be welcome.
    Regards
    Eric.

    When you get back the result of a query in JDBC you get a ResultSet object.
    Off of that you can obtain a ResultSetMetaData object which fully describes the result set - column names, types, scale and precision, etc. You can use that for dynamic processing of your result set, for example if you wanted to display it in a table.

  • Stop query on run on report startup

    Hi
    how to stop query on run on interactive report startup
    Thanks

    Hello,
    What do you mean exactly by "interactive report startup" ?
    Else, if you want to stop a running query you may kill the corresponding session.
    So with OEM or by querying the v$session you may identify the session (sid, serial#) of the query
    to stop. For instance:
    alter session set nls_date_format = 'DD-MM-YYYY HH24:MI:SS';
    select sid, serial#, status, schemaname, osuser, program, sql_id, logon_time
    from v$session;Then, you may execute the following statement so as to KILL the session:
    alter system kill session '<sid>,<serial#>';You may find some examples on the link below:
    [http://www.psoug.org/reference/kill_session.html]
    Hope this help.
    Best regards,
    Jean-Valentin

  • Upto how many characters will accept in SELECT query  SENDER JDBC (PI 7.1)

    Hi Friends,
    I have to use Sender JDBC adapter in SAP PI 7.1, I need to use SELECT query only.
    I have a SELECT query is around 2 pages. Is this will accepet in SENDER JDBC in PI 7.1
    Thanks in advance.

    Hi Challarapu,
    You can check it out and if it is not accepted by the same then you need to check the maximal length @ DB settings or JDBC Settings whether it is limited. If not then you are allowed.
    Hope this helps.
    Regards
    Pothana

  • SQL Query in JDBC Sender

    Hi friends,
    Can u plz tell me when exactly we can use "Query SQL Stmt" and "Update SQL Stmt"?

    If you have a scenario that uses the JDBC adapter to connect to the "sending" system and pull data out of it, you will use these options. 
    You formulate a SQL statement that queries the database and gets certain information, the JDBC adapter then uses that information to populate the message type that you built in the integration repository. 
    You then create an update statement with SQL to tell the database what to do after it has grabbed the data it needs and populated the message type for mapping.
    Say for example you wanted to get all the data from the usr01 table in your SAP database (bad example, but bare with me) you could do something like this:
    <b>SQL QUERY STATEMENT:</b>  SELECT * FROM USR01
    And then following that you wanted to change the MANDT table (once again, don't actually run this command)
    <b>UPDATE SQL STATEMENT:</b>  UPDATE USR01 SET MANDT='100' WHERE MANDT='100'
    Message was edited by:
            Ethan West

  • SQL-Query with JDBC returns error ORA-00600

    Hi,
    I try to execute a SQL-Query using JDeveloper 3.2.3 and the Oracle JDBC-Library 8.1.7
    The following statement
    'ResultSet rset=stmt.executeQuery(SQL-String);'
    where stmt is Statement returns a Database-Error
    ORA-00600 with the Arguments [ttcgcshnd-1], [0] [], [], [], [], [], []
    when the SQL-String queries Varchar2 or CHAR-Columns.
    The Query returns correct values for numeric fields.
    The Database-Server is running on Oracle 9i
    Does anybody know, what could be the reason?
    Thanks, Harold

    I found many forums about it also, but I still haven't got solution yet.
    They talk about the cause, and report to oracle group and so on,
    but I still don't know how to solve my problem and how to enable my oracle 9i jdbc driver working.
    Need help please

  • Strange query from JDBC Thin Client on all_arguments

    Hi,
    in my statspack report I can see that query
    SELECT   package_name AS procedure_cat, owner AS procedure_schem,
             object_name AS procedure_name, argument_name AS column_name,
             DECODE (POSITION,
                     0, 5,
                     DECODE (in_out, 'IN', 1, 'OUT', 4, 'IN/OUT', 2, 0)
                    ) AS column_type,
             DECODE (data_type,
                     'CHAR', 1,
                     'VARCHAR2', 12,
                     'NUMBER', 3,
                     'LONG', -1,
                     'DATE', 93,
                     'RAW', -3,
                     'LONG RAW', -4,
                     'TIMESTAMP', 93,
                     'TIMESTAMP WITH TIME ZONE', -101,
                     'TIMESTAMP WITH LOCAL TIME ZONE', -102,
                     'INTERVAL YEAR TO MONTH', -103,
                     'INTERVAL DAY TO SECOND', -104,
                     'BINARY_FLOAT', 100,
                     'BINARY_DOUBLE', 101,
                     1111
                    ) AS data_type,
             DECODE (data_type,
                     'OBJECT', type_owner || '.' || type_name,
                     data_type
                    ) AS type_name,
             DECODE (data_precision,
                     NULL, data_length,
                     data_precision
                    ) AS PRECISION,
             data_length AS LENGTH, data_scale AS scale, 10 AS radix,
             1 AS nullable, NULL AS remarks, SEQUENCE, overload, DEFAULT_VALUE
        FROM all_arguments
       WHERE owner LIKE :1 ESCAPE '/'
         AND object_name LIKE :2 ESCAPE '/'
         AND data_level = 0
         AND package_name LIKE :3 ESCAPE '/'
         AND (   argument_name LIKE :5 ESCAPE '/'
              OR (argument_name IS NULL AND data_type IS NOT NULL)
    ORDER BY procedure_schem, procedure_name, overload, SEQUENCE
    /its executed 7000 per day and its top logical i/o consuming .
    Whats the functionality behind that ?
    How can I speak with developers to get rid of that :) ?
    DB is 9.2.0.8
    Regards
    GregG

    Whats the functionality behind that ? A quick search over the Internet shows that it seems related to this Java class :
    oracle.jdbc.OracleDatabaseMetaData.getProcedureColumns

  • Query in JDBC

    Is it possible to scroll back through the ResultSet while setting its type as TYPE_SCROLL_SENSITIVE and concurrency as CONCUR_UPDATABLE. I tried doing this but it doesn't work for me. I get the exception Resultset type is TYPE_FORWARD_ONLY.
    Then one more query. .....
    When i use concurrency of resultset as CONCUR_READ_ONLY i am able scroll back, but it takes more time for fetching the data.....
    Please resolve my problem
    Thanks in advance.....

    Hi,
    >database connection details dynamically to the JDBC communication channel
    To my Knowledge  it is not  possible as of now.
    Regards
    Agasthuri Doss

  • Not comitting database after the update query in jdbc

    Hi all,
    This is the first time I am posting this. I have query excuting on racle DB. This is update query. after executing the i have called commint using con.commit(). But still it is not showing the modifications in oracle db.
    What could be went wrong? Any sugestion, please let me know. I think it is simple jdbc program. So i don't think i need to post the code. Application running in Unix machine.
    Regards & thanks,
    Nirmala Vijaya Sekhar Varre

    VijayTechM wrote:
    Connection con = null;
    Class.forName("oracle.jdbc.driver.OracleDriver");          
    hi all,
    // following is the code
    con = DriverManager.getConnection("jdbc:oracle:thin:@10.129.239.43:1529:PBILLING","BILLING","BILLING");
    boolean test = con.getAutoCommit(); //here I am getting 'true'
    String invoice_header_query = "update invoice_header set file_traffico = '" + zipFileName + "' where bill_ref_no = '" + billRefNo_ + "' and bill_ref_resets = '" + billRefResets_ + "' and arbor_instance_id = '" + arborID_ + "'";
    System.out.println("invoice_header_query---->"+invoice_header_query);
    smt = con.createStatement();
    int x = stmt.executeUpdate(query); // Here x = 1 printing so it is updating the one record
    // con.commit(); // Even I have tried call this method. But this will be useful when you are using the Transactioon.
    Could you please tell me what went write. I am using ojdbc14.jar.
    regards,
    VijayPost with code tags and where is your claimed exception handling?

  • Stop Query if it does not match with Condtions & Control the result count

    Dear All,
    I have requirement in my Environment, I have to stop the Queries which compromises these conditions
    1. If Query is running more than specified threshold (if it running more than 2 mins).
    2. If Query is fetching huge data (rows more than 1000 for example)
    Please note we have done enough study on resource governor, it works on compile time, we need to control the queries during run time. Also resource governor does not restrict the resources if they are free.
    Answers are appreciated.

    Hello,
    I would not advise you to do such things in your environment.2 mins is very less time how could you be so sure a 2 min query is bad. And your second point is totally baseless it wouldtake a query a fraction of secondto read 1000 rows.My answer would be please
    dont implement.
    If you want to test below query might achieve the first requirement, I have not tested it please treat this query as hint and optimize or add anything if required.
    If you schedule this query through agent for every 2 mins or 5 mins .It can achieve.But some query takes more time to rollback than to finish scheduling this would lead to unstable environment
    USE MASTER
    IF EXISTS (SELECT * FROM TEMPDB.SYS.ALL_OBJECTS WHERE NAME LIKE '#KILL_CONNECTION')
    BEGIN
    DROP TABLE #KILL_CONNECTION
    END
    CREATE TABLE #KILL_CONNECTION
    SESSION_ID INT
    ,TOTAL_ELAPSED_TIME BIGINT
    ,START_TIME DATETIME
    INSERT INTO #KILL_CONNECTION
    SELECT
    SESSION_ID
    ,TOTAL_ELAPSED_TIME
    ,START_TIME
    FROM SYS.DM_EXEC_REQUESTS
    WHERE TOTAL_ELAPSED_TIME > 7200 AND SESSION_ID > 50
    DECLARE @SESSION_ID BIGINT
    DECLARE @CMD VARCHAR(1000)
    DECLARE KILL_CONNECTION CURSOR FOR
    SELECT SESSION_ID
    FROM #KILL_CONNECTION
    OPEN KILL_CONNECTION
    FETCH NEXT FROM KILL_CONNECTION INTO @SESSION_ID
    WHILE @@FETCH_STATUS = 0
    BEGIN
    SET @CMD = 'KILL ' + @SESSION_ID
    EXECUTE (@CMD)
    END
    CLOSE KILL_CONNECTION
    DEALLOCATE KILL_CONNECTION godrop table #Kill_connection
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

Maybe you are looking for

  • Windows Firewall damaged by 'Windows 7 antivirus 2012'

    I run Windows 7. I think 64bit, not sure. I have been getting hit with a lot of rogue antiviruses and up till now have been fighting them off, but last night I was hit by a new rendition of "Windows 7 Antivirus 2012". I got a window saying explorer.e

  • Get path from string in an column

    I have an data with text and url. I need to seprate the url only in the column and display in sql query Need to get data after Url: and the next immediate " " {blank space} my data is like below seach engine Url: www.bing.com this is the world famous

  • New Error Message found when trying to open iTunes 7.3.1!!!!!!!!!!!!!!!!!

    It clearly says, "iTunes cannot run because it has detected a problem with your audio configuration." It didn't do this when i had iTunes 7.3. Why now? Can someone help me fix this?

  • General Workflow for documents Activation

    Hi Gurus I am using General workflow for documents to cater for the Absences approval process. However after I execute the process, the workflow is in ERROR state and showing me the following message "Error when starting a SWITCH branch". Any suggest

  • Flag for overriding TV zoom function? Or title-safe settings for zoomed video...

    Here's the problem: I've got SD spots with correctly set up title-safe graphics. However, I keep seeing the spots playing on HD TV's where the picture has been set to zoom/stretch, and consequently the title graphics are stretching off-screen. So the