Perform update directly on a data table

Hi,
I'm a totally newbie with Sun Java Creator.
I have follow the tutorial "Performing Inserts, Updates, and Deletes" and my web application work perfectly.
But now I would update my data (stored in a MySQL DB) directly on a data table.
I have drag and drop a data table, bind it and I have set all the column to "Input text (editable)". Then I create another column filled with buttons, the buttons have this code:
try
lineRowSet.setObject(1,(String) getValue("#{currentRow['LILINCOD']}"));
lineRowSet.execute();
lineRowSet.next();
lineRowSet.updateRow();
lineRowSet.commit();
catch (Exception e)
throw new FacesException(e);
But when I press the button I have this error:
Exception Details: javax.faces.FacesException
#{LinesFast.commit_action}: javax.faces.el.EvaluationException: javax.faces.FacesException: java.sql.SQLException: No parameters defined during prepareCall()
Can anyone help me please?
Thanx a lot.
galliva

Hi,
All the three rowsets that you see in the OnePage.jsp in AppModel are not bound to the datatable. One rowset is bound to the dropdown list to display the names of persons (personRowSet), second rowset is bound to the outputText to display the JobTitle of the selected person in the dropdown(personRowSet1) and the third rowset is bound to the datatable to display the trip details (tripRowSet).
Also when you are using the datatable which is bound to a rowset you can make use of dataTableModel to do the database table transactions as you can see in the AppModel example. If you will go through the code you will notice the dataTableModel1.execute(). So the AppModel is not complicated as it might appear.
Please do go through the sample application once again as it exactly demonstrates what you want to achieve.
Hope that helps
Cheers
Giri

Similar Messages

  • Update time dependent master data table

    Hi Experts,
    Load to ZCUSTOMER is failing bcause time dependent Q table has few customers in modified version. We applied change run process. Job is successfully done, but it is not updating q table.
    Please provide us the solution on updation of Q tables.
    Thanks...

    Hi Viren,
    Sorry for late reply.
    Your answer is helpful to us.
    We got an option for correct errors in q table of zcustomer.
    But further steps are performed by our onsite team.
    we dont know actual steps they have taken up to solve issue.
    But as said by sita, I think we need to access se14, to activate q table incase your answer doesn't work out.
    Thanks once again..

  • About updating the data table's column binding to the database..

    i have used
    com.sun.jsfcl.data.DataCache.Row row =
    dataTable1Model.getDataCache().get(dataTable1.getRowIndex());
    row.setDeleted(true);
    dataTable1Model.commit();
    dataTable1Model.execute();to delete the selected row in datatable,
    now i give the colum as inpu text. so if i click the update button in thr data table, i want to update the database by using data table, is it possible?
    i am writing code like
    rowset.absolute(datatable.getRowIndex() + 1);
    rowsert.updateRow();but i think this is really stupid...
    best regards
    koji

    wow...
    thats my mistake...sorry
    i know how to fix it...
    koji

  • Status control table - 'Perform update for status control table for cube '

    Hello Experts,
    While loading data to DSO, I am getting this message - 'Perform update for status control table for cube Z3MLQUA'.
    What is status control table ? and can I have some inputs as to how to solve this issue
    Regards,
    arjun

    Hi,
    This message is not a issue in itself. It is just a SAP message which means that the system is checking/updating the system tables to carry out the operation whether it can be done or not.
    If your loads are failing at this step or after this message there can be many reasons, check some of  the possible reasons below
    Performing check and potential update for status control table
    Update from PSA error in Process Chain
    problem in deleting request
    Reporting not available ,even if Data is sucessfully loaded into DT
    Hope this helps,
    Kush kashyap

  • Updated property of rowset is set for data table if I use convertors

    Hi,
    I use data table for update database table. What I use is sale tax table of Pointbase. I use convertors for date effect and tax rate.
    I just change 1 row of data table but Jcreator finds all row are updated. This is a waste of resource and performance. Here is the code (I copied from clip).
    public String saveButton_action() {
    // User event code here...
    log("OnePage: update_action()");
    // BYHAND - Count up the rows with updates (optional)
    int count = 0;
    Iterator keys = dataTable1Model.getDataCache().iterator();
    while (keys.hasNext()) {
    Integer key = (Integer) keys.next();
    com.sun.jsfcl.data.DataCache.Row row = dataTable1Model.getDataCache().get(key.intValue());
    if (row.isUpdated()) {
    count++;
    // BYHAND - Perform the actual update transaction and report results
    try {
    dataTable1Model.commit();
    info("Total rows updated: " + count);
    } catch (Exception e) {
    log("OnePage: Update commit exception", e);
    error("OnePage: Update commit exception: " + e);
    // BYHAND - Re-execute the query to pick up new results
    try {
    dataTable1Model.execute();
    } catch (SQLException e) {
    log("OnePage: Update reselect exception", e);
    error("OnePage: Update reselect exception: " + e);
    return null;
    My guess is jCreator compares the text from data table and rowset's cache (???). as I display date and rate in formats I need.
    My data table displays 10 rows so each time I change 1 row jCreator updates 10 rows of the data table.
    Need clarification on this.
    Cheers.

    Hi Hung,
    I received your email and was unable to reproduce using
    a new project.
    I want to reproduce this ASAP.
    Is this the same project you sent me previously?
    If not, then could you please email it to me again.
    Thank you
    John
    JSC QA

  • Trigger format to perform updates on another table

    Hello there,
    I am struggling to write a trigger that performs updates on table B when rows in my table A are updated , can anybody give me any general pointers in that direction?

    Duplicate thread:
    Will this trigger code work?
    (this one is earlier, but at least the other one has some code).

  • What are the tables will update while loading Master data ?

    Hello Experts,
    What are the tables will update while loading Master data ? And requesting you to provide more information about Master data loading and its related settings in the beginning of creation infoobjects. 

    It depends upon the type of Master data u r loading....
    In all the master data loadings, for every new value of master data an SID will be created in the SID table /BI*/S<INFOOBJECT NAME> irrespective of the type of master data.
    But the exceptional tables that get updated depending on the type of master data are.....
    If it is a time Independent master data then the /BI*/P<INFOOBJECT NAME> table gets updated with the loaded data.
    If it is a time dependent master data then the /BI*/Q<INFOOBJECT NAME> table gets updated with the loaded data.
    If the master data is of time Independent Navigational attributes then for every data load the SID table will get updated first and then the /BI*/X<INFOOBJECT NAME> table gets updated with the SID's created in the SID table (NOT WITH THE MASTER DATA).
    If the master data is of time dependent navigational attributes then for every data load the SID table will get updated first and then the /BI*/Y<INFOOBJECT NAME> table gets updated with the SID's created in the SID table (NOT WITH THE MASTER DATA).
    NOTE: As said above, For all the data in P, Q, T, X, Y tables the SID's will be created in the S table /BI*/S<INFOOBJECT NAME>
    NOTE: Irrespective of the time dependency or Independency the VIEW /BI*/M<INFOOBJECT NAME> defined on the top of /BI*/P<INFOOBJECT NAME> & /BI*/Q<INFOOBJECT NAME> tables gives the view of entire master data.
    NOTE: it is just a View and it is not a Table. So it will not have any physical storage of data.
    All the above tables are for ATTRIBUTES
    But when it comes to TEXTS, irrespective of the Time dependency or Independency, the /BI*/T<INFOOBJECT NAME> table gets updated (and of course the S table also).
    Naming Convention: /BIC/*<InfoObject Name> or /BI0/*<InfoObject Name>
    C = Customer Defined Characteristic
    0 = Standard or SAP defined Characteristic
    * = P, Q, T, X,Y, S (depending on the above said conditions)
    Thanks & regards
    Sasidhar

  • How to update a single row of data table

    How we can update a single row of the data table by clicking the button in the same row.
    Thanks in Advance.

    Hi!
    What do You mean 'update'? Get fresh data from DB or change data and commit it in DB?
    If commit, try to read here:
    http://developers.sun.com/jscreator/learning/tutorials/2/inserts_updates_deletes.html
    Thanks,
    Roman.

  • Compression getting disabled when performing Update on partitioned tables

    Hi All,
    I am on Oracle Database 11g Enterprise Edition Release 11.2.0.3.0.
    My question is related to Oracle Compression.
    I have a sub-partitioned table enabled with Basic Compression. In enabled compressed state, I am updating few columns of this table(Normal Update command and Merge as well) but the end result shows increase in the table size and the compression is still in ENABLED state. Post that, if I compress the sub-partition explicitly the table comes back to its original size.
    Is it a bug? I read a white paper on 11g itself, that compression remains enabled in case of all DML operations, then why this behaviour?
    Thanks,
    Ishan

    Ishan,
    taking a look at http://docs.oracle.com/cd/E11882_01/server.112/e25494/tables.htm#CJAGFBFG It seems that the distinction between OLTP and basic compression is sometimes a little bit vague ("Operations that permit compression include: ..."), but I can also find the statement "Rows inserted without using direct-path insert and updated rows are uncompressed." So I would say it's not a bug but a limitation of the feature. Updates just don't mix well with compression.
    Martin

  • Applied an update to an app that records blood pressure. Am unable to retr ieve previously stored info. When following directions in update I cannot "add" data to import because message states data are stored elsewhere and I cannot find where. Help?

    Applied an update to an app that records blood pressure. Am unable to retrieve previously stored info. When following directions in update, I cannot "add" data to import because message states data are stored elsewhere, and I cannot find where. Help?

    You'll have to contact the app developer for help with this.

  • JSF 1.1 performance, especially UIData and Data Table

    Hi,
    Does anybody have any JSF 1.1 (Sun reference implementation) performance experiences to share? I am currently looking at the data table component and the use of UIData. Initial observations are an incredible amount of memory is churned during rendering the data table, with the following classes culprits:
    java.util.HashMap$KeyIterator
    javax.faces.component.UIComponentBase$ChildrenListIterator
    java.util.AbstractList$Itr
    char[]
    java.util.ArrayList
    javax.faces.component.UIComponentBase$FacetsMapKeySetIterator
    javax.faces.component.UIComponentBase$FacetsMapKeySet
    javax.faces.component.UIComponentBase$FacetsMapValues
    javax.faces.component.UIComponentBase$FacetsAndChildrenIterator
    To render 50 rows with 10 columns (each column only having a simple outputText component) I'm seeing 1.3Mb memory churned and 0.8 seconds processing time.
    To rener 100 rows with same columns and components I'm seeing nearly 2Mb churned and 2 seconds processing time.
    UIData.setRowIndex is a large culprit.
    I'm really after finding out your experiences on JSF performance and its scalability.
    Any help here is appreciated.
    Thanks - JJ

    Hi,
    Does anybody have any JSF 1.1 (Sun reference implementation) performance experiences to share? I am currently looking at the data table component and the use of UIData. Initial observations are an incredible amount of memory is churned during rendering the data table, with the following classes culprits:
    java.util.HashMap$KeyIterator
    javax.faces.component.UIComponentBase$ChildrenListIterator
    java.util.AbstractList$Itr
    char[]
    java.util.ArrayList
    javax.faces.component.UIComponentBase$FacetsMapKeySetIterator
    javax.faces.component.UIComponentBase$FacetsMapKeySet
    javax.faces.component.UIComponentBase$FacetsMapValues
    javax.faces.component.UIComponentBase$FacetsAndChildrenIterator
    To render 50 rows with 10 columns (each column only having a simple outputText component) I'm seeing 1.3Mb memory churned and 0.8 seconds processing time.
    To rener 100 rows with same columns and components I'm seeing nearly 2Mb churned and 2 seconds processing time.
    UIData.setRowIndex is a large culprit.
    I'm really after finding out your experiences on JSF performance and its scalability.
    Any help here is appreciated.
    Thanks - JJ

  • Load XML data from UNIX Server Directly into Relational Database Tables

    Is there a way I can load data from an XML File into Oracle Tables , without having the Input XML file in some Oracle Server Directory. My XML File resides on UNIX Application server. And I need to directly load the data into Database tables. Without loading them into the Database Directory.
    Also I am looking for a solution that would not load my Database much and effect other running processes. Can it be done using SQL Loader ?
    Oracle Database Version is : Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

    Thanks for your reply ,
    Please would you quote an Example about : 'Load the file into that table using SQL*Loader'  (From UNIX Server) Or instance of some existing thread that relates to my situation.
    The Size of the File would be about 3 GB. For a similar requirement one of my peers Code which used XMLTABLE and XPATH Approach consumed a lot of resources while running and caused the other Database Applications to slow down. Thus those guys have come up with an approach to :
            Parse XML using a C Code using some STRING Functions =>  For a CSV or Fixed width .dat file and then use SQL Loader to just load the file into Tables.
            This approach is efficient in terms of Resources and Time(Takes 5 mins). But I am not confident about parsing XML based on String based C Functions.
             Please comment about this approach . Also if possible Suggest the best efficient way of doing this.

  • Field not being updated in Master Data table

    Hi guys,
    I'm pulling data from master data in BW... specifically 0ven_compc. I haven't added any new fields to this maser data table, and one field that I'm trying to pull is not being populated. In the master data table this field is blank, but in the PSA there are values. Somehow the values are not being loaded into the master data table. I've checked the transfer rules and communication structure and everything looks fine. Why is this happening?
    Thanks,
    Anthony

    Hi Anthony,
    The problem may be that there is an inconsistency with the target master data infoobject. Please make a dummy change to the target infoobject (i.e you can change the description), save this change and then click on the activate icon. Please then check if the field is filled with the next load.
    If the problem still exists please let us know your BI version and support package level.
    Best Regards,
    Des.

  • Error occurs when updating grid Data Table - invalid value type [66000-150]

    I am receiving the below error when using SetValue method of the Grid.DataTable object
    Error No:-7768
    Error Desc:Data Table - invalid value type [66000-150]
    Any idea on why this error will ocurr
    the data that I am trying to set is text and column data type is also text
    sincerely yours
    Ray

    Hi Ray,
    I kind of faced a similar problem wherein, my functionalities work perfectly fine in the devt. environ but doesn't even reflects in the production environ.   I kind of tried installing VS and removed it and things started working fine later.
    Reason might be that some of the devt. components are missing in the production environ, other than .NET framework.  If possible, you can try this.
    Regards,
    Satish.

  • Performance issues with version enable partitioned tables?

    Hi all,
    Are there any known performance issues with version enable partitioned tables?
    I’ve been doing some performance testes with a large version enable partitioned table and it seems that OCB optimiser is choosing very expensive plans during merge operations.
    Tanks in advance,
    Vitor
    Example:
         Object Name     Rows     Bytes     Cost     Object Node     In/Out     PStart     PStop
    UPDATE STATEMENT Optimizer Mode=CHOOSE          1          249                    
    UPDATE     SIG.SIG_QUA_IMG_LT                                   
    NESTED LOOPS SEMI          1     266     249                    
    PARTITION RANGE ALL                                   1     9
    TABLE ACCESS FULL     SIG.SIG_QUA_IMG_LT     1     259     2               1     9
    VIEW     SYS.VW_NSO_1     1     7     247                    
    NESTED LOOPS          1     739     247                    
    NESTED LOOPS          1     677     247                    
    NESTED LOOPS          1     412     246                    
    NESTED LOOPS          1     114     244                    
    INDEX RANGE SCAN     WMSYS.MODIFIED_TABLES_PK     1     62     2                    
    INDEX RANGE SCAN     SIG.QIM_PK     1     52     243                    
    TABLE ACCESS BY GLOBAL INDEX ROWID     SIG.SIG_QUA_IMG_LT     1     298     2               ROWID     ROW L
    INDEX RANGE SCAN     SIG.SIG_QUA_IMG_PKI$     1          1                    
    INDEX RANGE SCAN     WMSYS.WM$NEXTVER_TABLE_NV_INDX     1     265     1                    
    INDEX UNIQUE SCAN     WMSYS.MODIFIED_TABLES_PK     1     62                         
    /* Formatted on 2004/04/19 18:57 (Formatter Plus v4.8.0) */                                        
    UPDATE /*+ USE_NL(Z1) ROWID(Z1) */sig.sig_qua_img_lt z1                                        
    SET z1.nextver =                                        
    SYS.ltutil.subsversion                                        
    (z1.nextver,                                        
    SYS.ltutil.getcontainedverinrange (z1.nextver,                                        
    'SIG.SIG_QUA_IMG',                                        
    'NpCyPCX3dkOAHSuBMjGioQ==',                                        
    4574,                                        
    4575                                        
    4574                                        
    WHERE z1.ROWID IN (
    (SELECT /*+ ORDERED USE_NL(T1) USE_NL(T2) USE_NL(J2) USE_NL(J3)
    INDEX(T1 QIM_PK) INDEX(T2 SIG_QUA_IMG_PKI$)
    INDEX(J2 WM$NEXTVER_TABLE_NV_INDX) INDEX(J3 MODIFIED_TABLES_PK) */
    t2.ROWID
    FROM (SELECT /*+ INDEX(WM$MODIFIED_TABLES MODIFIED_TABLES_PK) */
    UNIQUE VERSION
    FROM wmsys.wm$modified_tables
    WHERE table_name = 'SIG.SIG_QUA_IMG'
    AND workspace = 'NpCyPCX3dkOAHSuBMjGioQ=='
    AND VERSION > 4574
    AND VERSION <= 4575) j1,
    sig.sig_qua_img_lt t1,
    sig.sig_qua_img_lt t2,
    wmsys.wm$nextver_table j2,
    (SELECT /*+ INDEX(WM$MODIFIED_TABLES MODIFIED_TABLES_PK) */
    UNIQUE VERSION
    FROM wmsys.wm$modified_tables
    WHERE table_name = 'SIG.SIG_QUA_IMG'
    AND workspace = 'NpCyPCX3dkOAHSuBMjGioQ=='
    AND VERSION > 4574
    AND VERSION <= 4575) j3
    WHERE t1.VERSION = j1.VERSION
    AND t1.ima_id = t2.ima_id
    AND t1.qim_inf_esq_x_tile = t2.qim_inf_esq_x_tile
    AND t1.qim_inf_esq_y_tile = t2.qim_inf_esq_y_tile
    AND t2.nextver != '-1'
    AND t2.nextver = j2.next_vers
    AND j2.VERSION = j3.VERSION))

    Hello Vitor,
    There are currently no known issues with version enabled tables that are partitioned. The merge operation may need to access all of the partitions of a table depending on the data that needs to be moved/copied from the child to the parent. This is the reason for the 'Partition Range All' step in the plan that you provided. The majority of the remaining steps are due to the hints that have been added, since this plan has provided the best performance for us in the past for this particular statement. If this is not the case for you, and you feel that another plan would yield better performance, then please let me know and I will take a look at it.
    One suggestion would be to make sure that the table was been recently analyzed so that the optimizer has the most current data about the table.
    Performance issues are very hard to fix without a reproducible test case, so it may be advisable to file a TAR if you continue to have significant performance issues with the mergeWorkspace operation.
    Thank You,
    Ben

Maybe you are looking for