Connecting grid to view\query

I need some tutorial sample project explaining how to connect a grid to view\query from a DB. I failed to google it - any links?

The grid is called JTable.
[JTable tutorial|http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]
You can find examples and similar questions in the [JDBC forum|http://forums.sun.com/forum.jspa?forumID=48].
There's also a link to the [JDBC FAQ|http://java.sun.com/products/jdbc/faq.html].

Similar Messages

  • VIEW Query Problem

    Hi Greg,
    I had created a view on a table which doesn't have Primary Key, but it has Unique and Not Null constraints on required columns.
    I had wrote a procedure to query the data on VIEW. I have experienced strange problem, very first call to procedure will take more time than succeeding requests. For example from second request onwards, it returns data in < 2 Sec, but first transaction is taking 12 Sec to 30 Sec.
    I thought that very first time VIEW is taking time to refresh it self. So, I added FORCE keyword in CREATE VIEW stattement. However, that doesn't helped out.
    In my further investigation I came to know that base table on which VIEW created, has to be loaded in to memory before querying on VIEW.
    So, I had executed a simple select statement on base table, before I execute VIEW query in procedure.
    With this change I got results consistently < 2 Sec all the times.
    My question is instead of executing the select statement on base table is there a way to load base tables data in memory before querying on VIEW?
    Thanks,
    Subbarao

    Hi,
    A view is nothing but parsed SQL statements stored in the database, a view may or may not run faster. If you execute the SQL used to define the view how much time is it taking. If you want try looking at MATERIALIZED VIEW , that may help you.
    thanks

  • Reg: fetch the data by using item_id which is retuned by In line View Query

    Hi all,
    create table xxc_transactions(type_id number,trx_line_id number ,item_id number,org_id number);
    insert into xxc_transactions values(null,null,null,null);
    create table xxc_items1(item_id number,org_id number,item_no varchar2(10));
    insert into xxc_items1 values(123,12,'book');
    create table xxc_headers(header_id number,order_id number);
    insert into xxc_headers values(null,null);
    create table xxc_lines(header_id number,item_id number,line_id number);
    insert into xxc_lines values(null,null,null);
    create table xxc_types_tl(transaction_id number,NAME varchar2(10));
    insert into xxc_types_tl values(106,'abc');
    create table xxc_quantity(item_id number);
    insert into xxc_quantity values (123);
    create table xxc_quantity_1(item_id number);
    insert into xxc_quantity_1 values (123);
    SELECT union_id.item_id,
           b.org_id,
           e.name,
           fun1(union_id.item_id) item_no
    FROM   xxc_transactions a,
           xxc_items1 b,
           xxc_headers c,
           xxc_lines d,
           xxc_types_tl e,
           (SELECT item_id
            FROM   xxc_quantity
            WHERE  item_id = 123
            UNION
            SELECT item_id
            FROM   xxc_quantity_1
            WHERE  item_id = 123
            UNION
            SELECT item_id
            FROM   xxc_transactions
            WHERE  item_id = 123) union_id
    WHERE  a.type_id = 6
           AND a.item_id  = b.item_id
           AND union_id.item_id = b.item_id
           AND a.org_id = b.org_id
           AND c.header_id = d.header_id
           AND d.line_id = a.trx_line_id
           AND d.item_id = b.item_id
           AND c.order_id = e.transaction_id
           AND b.org_id = 12
    GROUP  BY union_id.item_id,
              b.org_id,
              e.name
    ORDER  BY union_id.item_id;
    create or replace function fun1(v_item in number)
    return varchar2
    is
    v_item_no
    Begin
       select item_no from xxc_items1
       where item_id=v_item;
       return v_item_no ;
        Exception
         When Others Then
          v_item_no := null;
          return v_item_no;
    END fun1;
    I  need  fetch the data by using item_id which is retuned by In line View Query(UNION)
    item_id  org_id  name    item_no
    123        12        abc       book
    Version: 11.1.0.7.0  and 11.2.0.1.0
    Message was edited by: Rajesh123 Added test cases script
    Message was edited by: Rajesh123 changed Question as fetch the data by using item_id which is retuned by In line View Query(UNION)

    Hi Master , sorry for the late reply and can you please help on this?
    create table xxc_transactions(type_id number,trx_line_id number ,item_id number,org_id number);
    insert into xxc_transactions values(null,null,null,null);
    create table xxc_items(item_id number,org_id number,item_no varchar2(10));
    insert into xxc_items values(123,12,'book');
    create table xxc_headers(header_id number,order_id number);
    insert into xxc_headers values(null,null);
    create table xxc_lines(header_id number,item_id number,line_id number);
    insert into xxc_lines values(null,null,null);
    create table xxc_types_tl(transaction_id number,NAME varchar2(10));
    insert into xxc_types_tl values(106,'abc');
    create table xxc_uinon_table(item_id number);
    insert into xxc_types_tl values(123);
    SELECT   union_id.item_id,
             b.org_id ,
             e.name ,
             fun1(union_id.item_id) item_no   --> to get item_no
             FORM xxc_transactions a,
             xxc_items             b,
             xxc_headers           c,
             xxc_lines             d,
             xxc_types_tl          e,
             ( SELECT item_id
                 FROM   xxc_uinon_table ) union_id
    WHERE    a.type_id= 6
    AND      a.item_id = b.item_id
    AND      union_id.item_id = b.item_id
    AND      a.org_id = b.org_id
    AND      c.header_id = d.header_id
    AND      d.line_id= a.trx_line_id
    AND      d.item_id= b.item_id
    AND      c.order_id= e.transaction_id ---106
    AND      b.org_id = 12
    GROUP BY union_id.item_id,
             b.org_id ,
             e.name
    ORDER BY union_id.item_id;
    Note: xxc_uinon_table is a combination of UNION's
    select 1 from dual
    union
    select 1 from dual
    union
    select no rows returned  from dual;
    I will get 1 from the above Query
    Thank you in advanced

  • Spatial vs. materialized views/query rewrite

    Dear all,
    we are trying to use Spatial (Locator) functionality together with performance optimization using materialized views and query rewrite, and it does not seem to work. Does anybody has experience with this?
    The problem in more detail:
    * There is a spatial attribut (vom Typ GEOMETRY) in our table;
    * we define a materialized view on that table;
    * we run a query that could be better answered using the materialized view with query rewrite;
    *the optimizer does not choose the plan using the materialized view, query rewrite does not take place;
    This happenes, even if neither the materialized view, nor the query contains the spatial attribut.
    The explanation given by the procedure DBMS_MVIEW.Explain_Rewrite is:
    "QSM-01064 query has a fixed table or view Cause: Query
    rewrite is not allowed if query references any fixed tables or views"
    We are using Oracle 9R2, Enterprise Edition, with locator. Nevertheless, it would also be interesting, if there is any improvement in 10g?
    A more complicated task, using materialized views to optimize spatial operations (e.g., sdo_relate) would also be very interesting, as spatial joins are very expensive operations.
    Thanks in advance for any comments, ideas!
    Cheers,
    Gergely Lukacs

    Hi Dan,
    thanks for your rapid response!
    A simple example is:
    alter session set query_rewrite_integrity=trusted;
    alter session set query_rewrite_enabled=true;
    set serveroutput on;
    /* Creating testtable */
    CREATE TABLE TESTTABLE (
    KEY1 NUMBER (4) NOT NULL,
    KEY2 NUMBER (8) NOT NULL,
    KEY3 NUMBER (14) NOT NULL,
    NAME VARCHAR2 (255),
    X NUMBER (9,2),
    Y NUMBER (9,2),
    ATTR1 VARCHAR2 (2),
    ATTR2 VARCHAR2 (30),
    ATTR3 VARCHAR2 (80),
    ATTR4 NUMBER (7),
    ATTR5 NUMBER (4),
    ATTR6 NUMBER (5),
    ATTR7 VARCHAR2 (40),
    ATTR8 VARCHAR2 (40),
    CONSTRAINT TESTTABLE_PK
    PRIMARY KEY ( KEY1, KEY2, KEY3 ));
    /* Creating materialized view */
    CREATE MATERIALIZED VIEW TESTTABLE_MV
    REFRESH COMPLETE
    ENABLE QUERY REWRITE
    AS SELECT DISTINCT ATTR7, ATTR8
    FROM TESTTABLE;
    /* Creating statistics, just to make sure */
    execute dbms_stats.gather_table_stats(ownname=> 'TESTSCHEMA', tabname=> 'TESTTABLE', cascade=>TRUE);
    execute dbms_stats.gather_table_stats(ownname=> 'TESTSCHEMA', tabname=> 'TESTTABLE_MV', cascade=>TRUE);
    /* Explain rewrite procedure */
    DECLARE
    Rewrite_Array SYS.RewriteArrayType := SYS.RewriteArrayType();
    querytxt VARCHAR2(1500) :=
    'SELECT COUNT(*) FROM (
    SELECT DISTINCT
    ATTR8 FROM
    TESTTABLE
    i NUMBER;
    BEGIN
    DBMS_MVIEW.Explain_Rewrite(querytxt, 'TESTTABLE_MV', Rewrite_Array);
    FOR i IN 1..Rewrite_Array.count
    LOOP
    DBMS_OUTPUT.PUT_LINE(Rewrite_Array(i).message);
    END LOOP;
    END;
    The message you get is:
    QSM-01009 materialized view, string, matched query text
    Cause: The query was rewritten using a materialized view, because query text matched the materialized view text.
    Action: No action required.
    i.e. query rewrite works!
    /* Adding geometry column to the testtable -- not to the materialized view, and not to the query! */
    ALTER TABLE TESTTABLE
    ADD GEOMETRYATTR mdsys.sdo_geometry;
    /* Explain rewrite procedure */
    DECLARE
    Rewrite_Array SYS.RewriteArrayType := SYS.RewriteArrayType();
    querytxt VARCHAR2(1500) :=
    'SELECT COUNT(*) FROM (
    SELECT DISTINCT
    ATTR8 FROM
    TESTTABLE
    i NUMBER;
    BEGIN
    DBMS_MVIEW.Explain_Rewrite(querytxt, 'TESTTABLE_MV', Rewrite_Array);
    FOR i IN 1..Rewrite_Array.count
    LOOP
    DBMS_OUTPUT.PUT_LINE(Rewrite_Array(i).message);
    END LOOP;
    END;
    The messages you get are:
    QSM-01064 query has a fixed table or view
    Cause: Query rewrite is not allowed if query references any fixed tables or views.
    Action: No action required.
    QSM-01019 no suitable materialized view found to rewrite this query
    Cause: There doesn't exist any materialized view that can be used to rewrite this query.
    Action: Consider creating a new materialized view.
    i.e. query rewrite does not work!
    If this works, the next issue is to use materialized views for optimizing spatial operations, e.g., a spatial join. I can supply you with an example, if necessary (only makes sense, I think, after the first problem is solved).
    Thanks in advance for any ideas, comments!
    Cheers,
    Gergely

  • Crystal reports 2013 , SAP MDX Driver not able to connect with BW BEX Query

    Hi All,
    We just installed Crystal 2013, and want to create crystal report on SAP BW CUBE/BEX Query through SAP MDX Driver.
    1.When start connecting through SAP MDX Query option from new connection , SAP Systems which are in SAPLOGON are not appearing in initial screen. where as from OLAP Connection we are able to connect to SAP BEX Query.
    2.Even from SAP Tool kit we are not able to connect to BEX query, we are getting ERROR MESSAGE.
    and we are using SAP BI BO PLATFORM 4.1 sp01 .
    Please suggest me , if I am missing any configuration settings.
    Regards,
    Joseph

    Hi Joseph,
    Before you start building the report, make sure the right transports have been loaded on the SAP System. The right Transport files are the ones found inside the installation zip you download from SAP's server. They're under the "Collaterals\Add-Ons\SAP\Transports" folder.
    For more info on Transports, authorizations etc, please have your BASIS admin go through this wiki:
    Crystal Reports 2008 and BW - Installation and Configuration - Business Intelligence (BusinessObjects) - SCN Wiki
    To resolve your first issue, please follow the steps from this thread:
    Problems with SAPLogon.ini for SAP GUI and Crystal 2011
    P.S: Crystal Reports for Enterprise 4.1 does a better job at handling BEx queries that the CR 2013 designer. It directly connects to BEx queries via the BICS connectivity driver and doesn't need the Transports to be there on the SAP System. You might want to give this flavour of CR a try too.
    -Abhilash

  • How to create dynamic connection in business view manager.

    Hi Sir,
    Can u explain how to create dynamic connection in business view manager.
    Thanks
    Vishali Raghava Raju

    HI Vaishali,
       Can you please elaborate your requirement ?
    -Regards
    B

  • Save Query - An error occurred while creating connection strings for the query

    A workbook trying to edit and reload I get the following error "Save Query - An error occurred while creating connection strings for the query" No Power Pivot data model or anything.

    I am getting the same error when editing a Power Query in an Excel spreadsheet. It happens when I change a Group By step to do a Sum instead of Count Rows.

  • Creating a Hierarchy Viewer query

    Hello,
    I'm having huge difficulties creating a Hierarchy Viewer Query. I've looked through the source code contained withing the demo, but it seems to require great knowledge regarding the component. I'm using a three-node model, each node grouped within it's parent.
    So I created a custom View to be used as a result list for the query and this part is working just fine. I can pick the unique ID for the node I want from the search results when the user selects one, but I don't know how I can make that specific node my "anchor", my "current node", after that.
    Since I'm looking for a specific "contact_id" selected from the search results, I think the correct way of doing it is finding it's node on the TreeModel, and then setting it as my current anchor.
    Please, any tips, directions or suggestions on how can I go about doing this?
    Thanks!!

    Hi!
    Thanks for the attention, but I've been through all the basic stuff. The HV documentation only teaches the most primitive part of it. I searched all blogs related to HV, all articles I could find, I've meddled with the demo source code and all I can think of, but I couldn't find anyone who would give much insight on the mechanics of the component or how to build a really powerful search engine for it.
    As a sugestion for the developer team, it would be great if the query for this component allowed us to specify actions to be performed on all levels of the tree, instead of only the root node, since most of the time people use HV as a multi-root tree.

  • Materialized view query (Oracle 9i)

    I have dropped a materialized view query and trying to create the same with additional columns in the prebuilt table.
    Option - 1
    when Iam using a query in the materialized view query "select * from schema.table@link, with refresh mode fast option, the database throws an error " no table or view exists"
    Option - 2
    When Iam using a query in the materialized view query "select * from schema.table@link, with refresh mode option either complete or force, it gets created.
    I need to create the above materialized view query in the fast mode option, Please help.
    -bala

    Hi,
    Does a table named profit_mvw already exist?
    The following example illustrates the two steps required to register a user-defined table. First, the table is created, then the materialized view is defined using exactly the same name as the table. This materialized view sum_sales_tab is eligible for use in query rewrite.
    CREATE TABLE sum_sales_tab
    PCTFREE 0 TABLESPACE demo
    STORAGE (INITIAL 16k NEXT 16k PCTINCREASE 0) AS
    SELECT s.prod_id, SUM(amount_sold) AS dollar_sales,
    SUM(quantity_sold) AS unit_sales
    FROM sales s GROUP BY s.prod_id;
    CREATE MATERIALIZED VIEW sum_sales_tab
    ON PREBUILT TABLE WITHOUT REDUCED PRECISION
    ENABLE QUERY REWRITE AS
    SELECT s.prod_id, SUM(amount_sold) AS dollar_sales,
    SUM(quantity_sold) AS unit_sales
    FROM sales s GROUP BY s.prod_id;
    Regards,
    Simon

  • ORA-01762: vopdrv: view query block not in FROM ????

    Hi All
    any one aware of the error.
    ORA-01762: vopdrv: view query block not in FROM
    Please reply back.

    ORA-01762:vopdrv: view query block not in FROM
    Cause:This is an internal error message not normally issued.
    Action:Contact Oracle Support Services.
    Edited by: Karthick_Arp on Sep 23, 2008 11:01 PM

  • How do I remove the grid in view permanently??

    I can't remove the grid in view of CS5.  It comes up on every photo I open though I uncheckk it it each time.  How do I

    Usually if you open an image into photoshop, turn off the grid and then close photoshop, that will keep the grid off.
    Close photoshop by using File>Exit or Photoshop>Quit Photoshop

  • Declaratively set the value of a bind parameter in a view query

    Can I declaratively set that I want the value of the bind parameter in the view query to be the value of a specific field in the current row of a specific iterator in my data bindings? Thanks :D

    user11976105 wrote:
    Hm I guess I should mention I'm doing the retrieval in Java, using a ValueChangeListenerIn this case, you will still need to bind an ExecuteWithParams action to your page definition and execute it from your ValueChangeListener after supplying its named data.
    In the code spinet, the new value from the ValueChangeEvent is passed to the bind variable.
    public void yourValidChangeListener(ValueChangeEvent valueChangeEvent) {
        // get the ExecuteWithParameters operation binding from the bindings
        OperationBinding executeWithParameters = ADFUtils.findOperation("yourExecuteWithParametersBindingId");
        // setup bind variable using the new value from the valueChangeEvent
        executeWithParameters.getParamsMap().put("yourParameterId", valueChangeEvent.getNewValue());
        // execute
        executeWithParameters.execute();
        // check for errors
        if(executeWithParameters.getErrors().size() != 0) {
            // error(s) occured
    }

  • Connection between two views

    Hi Experts,
    Please give me some inputs related to connection between two views ???

    Hi
    http://help.sap.com/saphelp_46c/helpdata/de/39/7dfeaaac6011d189c60000e829fbbd/frameset.htm
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2cceb190-0201-0010-be88-acdbeb2ad65f
    How to acces context of view B from view A without using the controller?
    http://help.sap.com/saphelp_nw04s/helpdata/en/7b/67eaa71bdf2645be6e811eee980a04/frameset.htm

  • View Query with DART

    Hi,
    I m tring to use the DART tool for extract tax data;
    We extact the tax data from 2 separately system SAP ECC6 (S1 et S2) with DART
    My question is :
    It is possible to use a extract file generate by S1 for executing view query in S2 system with the (FTWH) transaction
    Thank you for your help

    Hi,
    i m answer my self about this question
    it is possible to use a extraction file generated by S2 system in S1 system to query directely this file and we can also to use this file by view query transaction
    The only restriction is to use the same technical configuration for the both systems FTWP (technicals options)
    bye
    Mohamed

  • "ORA-01762: vopdrv: view query block not in FROM" while using LOG ERRORS INTO  feature for Update/Delete

    Hi
    Ours is VPD database in 11GR2. We're using "LOG ERRORS INTO " feature to track list of records violating constraints.
    For Inserts it is working as expected but for Updates/Deletes it is throwing mis. ORA- errors. "ORA-01762: vopdrv: view query block not in FROM"
    We dint find any clue when searched in net.
    Could someone help us here? Is there any limitation with "LOG ERRORS INTO" ?
    Below are the steps we're executing
    EXEC DBMS_ERRLOG.CREATE_ERROR_LOG(
    dml_table_name => 'EMP',
    err_log_table_name => 'ERR_EMP'
    > DESC EMP
    Name                                      Null?    Type
    EMPNO                                     NOT NULL NUMBER(4)
    ENAME                                              VARCHAR2(10)
    SAL                                                NUMBER(7,2)
    COMM                                               NUMBER(7,2)
    DEPTNO                                             NUMBER(2)
    INSERT INTO EMP VALUES('1','Test','@' /* generates Ora */,2,'2); -- ERR_EMP populated
    UPDATE EMP set SAL='@'
    where EMPNO='1' -- Throwing ORA-01762: vopdrv: view query block not in FROM
    Could someone help us?

    Hi
    Ours is VPD database in 11GR2. We're using "LOG ERRORS INTO " feature to track list of records violating constraints.
    For Inserts it is working as expected but for Updates/Deletes it is throwing mis. ORA- errors. "ORA-01762: vopdrv: view query block not in FROM"
    We dint find any clue when searched in net.
    Could someone help us here? Is there any limitation with "LOG ERRORS INTO" ?
    Below are the steps we're executing
    EXEC DBMS_ERRLOG.CREATE_ERROR_LOG(
    dml_table_name => 'EMP',
    err_log_table_name => 'ERR_EMP'
    > DESC EMP
    Name                                      Null?    Type
    EMPNO                                     NOT NULL NUMBER(4)
    ENAME                                              VARCHAR2(10)
    SAL                                                NUMBER(7,2)
    COMM                                               NUMBER(7,2)
    DEPTNO                                             NUMBER(2)
    INSERT INTO EMP VALUES('1','Test','@' /* generates Ora */,2,'2); -- ERR_EMP populated
    UPDATE EMP set SAL='@'
    where EMPNO='1' -- Throwing ORA-01762: vopdrv: view query block not in FROM
    Could someone help us?

Maybe you are looking for

  • Problem with iPad mini (iOS7)

    After installing iOS7 the keyboard respponds few seconds later when I type. How can I fix this problem?

  • Audio file "open with" default setting

    Hi, Each time i export a file from Logic, i see the Logic logo, and it says "open with" Logic if i make get info. I'd like to export audio files that would open with QuickTime as the default application. Where is that preference located ? thanks

  • Modify schedule from PO before MIGO finish

    Hi Experts, I need made a change on the schedule of the PO, before the Material Document was create. We are used the BADI -> MB_DOCUMENT_BADI with one implementation of the MB_DOCUMENT_BEFORE_UPDATE Interface. Our BAPI modify correctly the PO (BAPI_P

  • Access context of Component Controller from Views

    Hi,   In WD Java, I used to set attributes value for Context present in Component controller from the view. I used to write a piece of code at the view level for this. How do i do this in WD ABAP. I believ I have to get instance of Component controll

  • HT1978 how many network certificate I can install for 1 iphon or ipad? how can I check it is installed successfuly

    hi .. I have a email certificate in my profile for recieving my compmay email, when I login to company office Wifi, it ask me to accept a network certificate , I did accept it , but I can't find it in profile. My questiosn are: 1) How can I check whe