Trouble updating the database

Hi,
I using java studio creator 2 update 1. I have two pages. The first page contains a table with hyperlinks in serial_no column. When the user clicks on a hyperlink(serial_no) it redirects to another page which displays the details of the product that can be edited as drop down lists and text areas. I am not able to update the database with the edited values. I have been struggling with this since a week. Please help me. The code in the second page is as follows
public void prerender() {
serialNo = (String)getExternalContext().getRequestParameterMap().get("SerialNo");
try
getSessionBean1().getTblSampleRowSet4().setCommand("select Username, Problem_Type, Priority , Enhancement, Time, Source_req, Assigned_To,substring_index(Comment,'<END>',-1) as 'userComment', Solution, serial_no from tblSample where serial_no = " + serialNo);
stUserName.setText(getSessionBean1().getTblSampleRowSet4().getString("Username"));
ddlProblemType.setSelected(getSessionBean1().getTblSampleRowSet4().getString("Problem_Type"));
String priority = getSessionBean1().getTblSampeRowSet4().getString("Priority");
outputText1.setValue(priority);
ddlPriority.setSelected(getSessionBean1().getTblSampleRowSet4().getString("Priority"));
// ddlp.setSelected(getSessionBean1().getTblSampleRowSet4().getString("Priority"));
ddlEnhancement.setSelected(getSessionBean1().getTblSampleRowSet4().getString("Enhancement"));
ddlTime.setSelected(getSessionBean1().getTblSampleRowSet4().getString("Time"));
ddlSourceReq.setSelected(getSessionBean1().getTblSampleRowSet4().getString("Source_req"));
ddlAssignedTo.setSelected(getSessionBean1().getTblSampleRowSet4().getString("Assigned_To"));
taSolution.setText(getSessionBean1().getTblSampleRowSet4().getString("Solution"));
taUserComment.setText(getSessionBean1().getTblSampleRowSet4().getString("userComment"));
catch(Exception e)
* <p>Callback method that is called after rendering is completed for
* this request, if <code>init()</code> was called (regardless of whether
* or not this was the page that was actually rendered). Customize this
* method to release resources acquired in the <code>init()</code>,
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
* acquired during execution of an event handler).</p>
public void destroy() {
tblSampleDataProvider4.close();
// tblSampleDataProvider.close();
public String btnSave_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
try {
tblSampleDataProvider4.setValue("tblSample.Problem_Type", ddlProblemType.getSelected());
tblSampleDataProvider4.setValue("tblSample.Priority", ddlPriority.getSelected());
tblSampleDataProvider4.setValue("tblSample.Enhancement", ddlEnhancement.getSelected());
tblSampleDataProvider4.setValue("tblSample.Time", ddlTime.getSelected());
tblSampleDataProvider4.setValue("tblSample.Source_req", ddlSourceReq.getSelected());
tblSampleDataProvider4.setValue("tblSample.Assigned_To",ddlAssignedTo.getSelected());
tblSampleDataProvider4.setValue("tblSample.Comment",taUserComment.getText());
tblSampleDataProvider4.setValue("tblSample.Solution", taSolution.getText());
tblSampleDataProvider4.commitChanges();
tblSampleDataProvider4.refresh();
} catch (Exception ex) {
outputText1.setValue("error");
return null;
If i use
getSessionBean1().getTblSampleRowSet4().execute(); after setting the command, it doesnt work. But if i comment it out, data corresponding to the serial no passes gets displayed. But I am not able to update the table with edited data.
S

Just a quick comment--
You won't need rowset.getString(..) and dataprovider.setValue(...) if you bind the components and it could make it much simpler.
There's a step by step tutorial on how to achieve this:
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/inserts_updates_deletes.html
If you can zip up the Project and email to me at CreatorFeedback AT sun DOT com, i can take a quick look at it. I would need your schema/SQL script as well.
HTH,
Sakthi

Similar Messages

  • Regardig error while updating the database table

    hi experts,
       i m trying to update the database table from the values containig in my internal table  ,,,but the system is giving this error plz help me::::
    The type of the database table and work area (or internal table)
    "ITAB_UPDATE" are not Unicode convertible. Unicode convertible.          
    my internal table name itab_update and the database table name yitab.i m using this statement::
        modify yitab from itab_update.

    Hi
    1. You  have to Declare the Itab with the same structure as DB table.
    2. Use the statement
        Modify <DBtable> from TABLE <itab>.
    or
       Update <DBtable> from TABLE <itab>.
    Hope this will solve.
    Reward .....if so.
    Regards.

  • I am having trouble updating the operating system on both my ipad and iphone. I get a strange message when I open my PC desk top that says "the procedure entry point sqlit3_wal-checkpoint could not be located in teh dynamic link library SQLite3.dll"

    I am having trouble updating my operatI am having trouble updating the operating system on both my ipad and iphone. I get a strange message when I open my PC desk top that says "the procedure entry point sqlit3_wal-checkpoint could not be located in the dynamic link library SQLite3.dll"  Any ideas what my problem is?

    Hi whatsthe77,
    Welcome to Apple Support Communities.
    You may want to follow the steps in this article to reinstall iTunes:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    Have a great day,
    Jeremy

  • Application Compatibility does not update the database.

    Hi,
     I am using application compatibility manager 6.1, and SQL server 2012 as database. ACT run ok and it create the XML file but it does not update the database at "C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA" location.
    I can see the valid XML file but somehow the MDF file of database is not updated so my ACT windows does not showing anything on it.
    Any Help would be appreciated.
    Thanks
    Rakesh Patel
    rakesh patel

    Hi Rakesh,
    I am not sure if you have resloved your issue.
    But for helping others to know what to do if they meet the same issue as yours, I consider to mark the post as answered.
    If you would like further assistance, please post back and we will be always here to help you.
    Any concern about this mark behavior, you can just unmark it.
    Thanks for your understanding.
    Regards,
    Kelvin hsu
    TechNet Community Support

  • Change the data in fieldcat and update the database table in alv oops

    Hi,
    my requirement is i have displayed a fieldcat in change mode and when i change the data and click on save it has to be updated the database table..
    this has to be done using alv oops...

    Hi,
    This code will reflect all the changes into the internal table that is being displayed.
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    Now after this code is executed the internal table is modified as per the changes done in alv output.
    Now you can use this internal table to update the database table.
    Hope this helps you.
    Regards,
    Tarun

  • Update the database structure from entity Framework Model

    Hello !
    I'm using VB.net , EF6 with SQL server 2008R2 database.
    This is the situation :
    I have created the application. Using wizard I have created the Entity model from an existing database.
    A client start using this application using this database on his computer.
    After some month , I made some modifications on the database and I have updated the model on my application .
    Now I have a new .exe file that has the new model from the new database.
    I put the new .exe file on the client computer.
    Now on his computer : The .exe file has the new database model , but the sql server database has the old structure.
    I want to know : Is possible to update the database structure from the entity model on application ?
    I want to add a command on application that can make ( if is possible ) this update , so the database become up to date according to entity model ?
    Thank you !

    Hello,
    From your description, it seems that you want to apply a migration for a database first approach, unfortunately, as far as I know, EF Migrations is a product targeted at Code First and doesn't support Database First operations. A workaround I know is to
    use update-scripts. If your database structure would be changed frequently, it is recommended to use the Code First approach which would have a better workaround for migrations, for details, you could refer to this
    video,
     and with the
    Entity Framework Power Tools, it is easy to create a code first based project form an existing database.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Using Tabstrip update the database table

    Hi Guy's,
    I created two screens(100 & 110).
    Click 1 pushbutton HRP1000 related information is displayed.
    Click 2 pushbutton it displays HRP1001 relatd information.
    worked to read the data from the Database tables and output displayed sucessfuly .   However i want to entered data in those fields wants to update to database table.
    Please friends help me how to work this senario.
    Thanks and Regards,
    Sai.

    Hi Guy's,
    To update the database records, wrote the logic in PAI
       WHEN 'SAVE'.
        INSERT HRP1001.
    INSERT INTO HRP1001  VALUES wa_P2.
    it displaying an error message " the work area wa_p2 is not long enough.
    and also i tried using it_p2
    it displaying an error message " you can't use internal table as work area".
    Please help me friends  it is very urgent.
    Thanks and Regards,
    Sai.

  • Update the database table

    Hi All,
      i need to do  direct update to the database table and the table has apprx 60,000 records . i am getting all records from database table to internal table and has to chnage the one of the field value and pass it to the database table .  So  i am looping  the internal table and what is the best approach to update the database table is it to  use UPDATE Pa0001 SET KOSTL = it_0001-KOSTL from table it_0001  each time in the loop to update each record  and commit work which hits database for each record or use the statement UPDATE  pa0001 from table it_0001 and if count = 1000 then  COMMIT work in this way it will hit the database for every 1000 records . Appreciate your suggestions,
    Thanks,
    Latha.

    My Code to update PA0006 is :
    DATA:  t_pa0006 TYPE STANDARD TABLE OF pa0006 INITIAL SIZE 0,
           wa_pa0006 LIKE LINE OF t_pa0006,
           w_lin TYPE i.
    FIELD-SYMBOLS:  <fs_pa0006> LIKE LINE OF t_pa0006.
    SELECT * FROM pa0006 INTO TABLE t_pa0006 WHERE uname = 'PKHAROR'.
    LOOP AT t_pa0006 ASSIGNING <fs_pa0006>.
      <fs_pa0006>-stras = 'My Street'.
    ENDLOOP.
    DESCRIBE TABLE t_pa0006 LINES w_lin.
    UPDATE pa0006 FROM TABLE t_pa0006.
    IF sy-subrc EQ 0.
      COMMIT WORK.
      WRITE:/ w_lin, ' Records have been updated..'.
    ENDIF.
    Reward points for useful answers
    Regards
    Pradeep
    Regards
    Pradeep

  • Update the database table inside an user exit.

    Hi Experts,
    I have a issue where i have to update a custom table in an User exit.
    I am using Lock object for ENQUE/DEQUE.
    I have tried to use statements like UPDATE/MODIFY inside the user exit.
    But the problem is that it's not updating the database table at the same time.
    I know if i use COMMIT WORK it can update at the same time but it's not advisable to use COMMIT inside a work.and also it gives a short dump.
    The real issue is that this custom table is read for batch creation at the same time for different users.
    Now if it the program does not update the database table at the same time then other users also read the same data and create the same Batch number..
    While requirement is to create a different/unique batch numbers.
    Program is updating the table but it's taking time..so in between other users are creating the same batch number.
    Please guide me what would be the best solution for this.
    Regards,
    Amit Kumar Singh

    Thanks for your quick reply.
    My actually requirement is like that.
    I have to create a Process Order using tcode COR1.
    After passing some input value it goes inside an User Exit.
    There one Custom table is maintained which stores some fields like month,year,numeric key field,etc.
    The new batch number is created using the combination of these table fields.
    Once a new batch number is created it increment the numeric key field number by one.
    Issue is we have to update this new numeric field value into the database field so that other users can read a diffrent numeric field value.hence it will create a new/different batch number.
    Here i am not able to update the database table inside this User Exit.
    Table is geeting updated but after some time and out of this User Exit.
    Please suggest what's required in that case?
    Regards,
    Amit Kumar Singh
    Edited by: Amit  Singh on Feb 3, 2009 11:33 AM

  • Having trouble updating the plugin for camera raw on photoshop CS2

    I am having trouble updating the plugin for the camera raw on photo shop CS2. I downloaded the plugin and put it where the instructions told me but I still couldnt open raw photos. any help would be great

    Use the DNG converter for the latest camera support in CS2:
    Why doesn’t my version of Photoshop or Lightroom support my camera?: http://adobe.ly/ACRandDNG

  • Master-Detail table on the JSF is unable to update the database

    Hi all,
    In my ADF application I am using a master-deatail relationship datasource. I have to enter the detail rows for a master table row and submit the detail rows it should update the
    database. For this I created a master-detail table and dragged the same on to my JSF page as ADF Forms. I created the forms as ADF Form included all the buttons and submit button. I
    dragged CreateInsert operation from the detail table datacontrol on to the detail form. When I enter the detail and click on submit the data is not getting submitted in the database.
    Please help me in this.
    Thankd In Advance.

    There is no such thing as an iPhone 's3'.  There is a 3G which can only be updated to iOS 4.2.1 and a 3GS which can be updated to iOS 6.1.3.
    Which model iPhone is this?
    Identifying iPhone models

  • I'm having trouble updating the Creative Cloud desktop app (Error code: 62)

    I'm having trouble updating the desktop app. The application updater says its error code 62.
    Running on Mac OS X 10.9.5.

    Hi yongteck,
    Please refer to the help document and thread below where the issue has been resolved:
    1. Error "Failed to Install" Creative Cloud Desktop application
    2. Why do i keep on getting error 62?
    Regards,
    Sheena

  • An error occurred while attempting to update the database

    Hi
    the update from 2.82 to 2.9.0 fails for me with following message
    An error occurred while attempting to update the database.
    the update log ends like this
    [Microsoft][ODBC SQL Server Driver][SQL Server]DELETE failed because the
    following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify
    that SET options are correct for use with indexed views and/or indexes on
    computed columns and/or filtered indexes and/or query notifications and/or XML
    data type methods and/or spatial index operations.
    1> 2> 3> [16:56:20] RunShellCommand: Command: osql exited with code: 1
    [16:56:20] RunShellCommand: Exit code indicates failure.
    [16:56:20] UpdateDatabase: Failed to run database update script.
    hope that anyone can solv this for me

    It seems that my problem is with one of ldapservers.
    When the periodic update runs.
    then there will be error periodic update failed
    log file mdm_error looks like this
    [00:01:46] Failed running query:
    IF NOT EXISTS(SELECT LDAPContainerName FROM LDAPContainers WHERE LDAPContainerName=? AND LDAPServerSAKey = ?)
    BEGIN INSERT INTO LDAPContainers(LDAPContainerName, DisplayName, LDAPContainerType, ParentContainerSAKey,
    LDAPServerSAKey, LDAPMemberType, AllowHandsOffEnrollment) VALUES (?,?, 2,
    (SELECT LDAPContainerSAKey FROM LDAPContainers WHERE LDAPContainerName =? AND LDAPServerSAKey =?) , ?, 1, 1) END
    SQLError:
    I think this is the reason that the upgrade fails.
    How can i solve this?

  • HT1688 Why am I having trouble updating the new ios7.0.4 to my iphone 4s?

    Why am I having trouble updating the new ios7.0.4 to my iPhone 4s?

    There is no update for iOS 7.0.4.

  • Update the database.

    Hi,
    I have a (server 1) 10.2.0.3 on RHEL. I have upgraded it to (server 2) 11.2.0.1.0 on Windows 2003 Server. Tis was done three months back. The user have tested server 2 and said it is OK. Now they are ready to make it "the production" one. Now I have to update the database. (since during the period of testing, the server 1 was production and have more updated data.) How would I do that? Do I have to delete the old database on server 2, again create a new database, and then do the exp and imp? or is there another way?
    Thanks,

    Make a full export but only import the application schema's.
    Before doing that you have to drop the application schema user (cascade) and create the user again.
    The related tablespaces will still be there but they are empty because of dropping the schema user.
    After that you can import only the application schema's from the full export.
    Finally your production database is still the same but the application schema is updated with the latest data from the export dump.

Maybe you are looking for

  • Lms credentials

    Dear all, im getting the follwing error while i m uploading the file in Csv format by modifying the previous one Invalidfileformat: no Header information in the input file

  • Sequential execution of task

    Hello, I've written two tasks, namely Task A and Task B as shown in the attachment. My program works this way: 1. Firstly the 1st iteration in Task A executes. Upon completion, it waits for 0.5s and the data from the 1st iteration in Task A will be p

  • Change of email name on iCloud email

    Hi I have recently got married and so my surname has changed.  I have managed to change my name in my settings but this hasn't effected the actual email address. Can I change my actual email address to be my new surname  e.g. [email protected] to [em

  • L would like to capture VHS using an old Dazzle DVC 100 (analog to USB) to HD & DVD

    Is this possible? Can I just use Adobe to capture or do I need different software or hardware? This is for family home videos. Thank you

  • Quitar sombra de pantalla de inicio

    Quitar sombra de pantalla de inicio