Using the statement prepared in adf

Hi Experts,
I am confused with the use of a prepared statement in the adf.
My use case is,
I have to update a table from every page in my application under certain conditions.

My question is,
If I have to create the iterator VO mandatory in all pages and calling the createinsert and insert the data into the table or

use a common method in the Application module impl
who uses a prepared statement (which is not even creating the ViewObject) like
 PreparedStatement st = null;
String sql = "INSERT INTO hr.departments (DEPARTMENT_ID,    DEPARTMENT_NAME,   MANAGER_ID,   LOCATION_ID) VALUES (seq,?,?,?)";
            st=getDBTransaction().createPreparedStatement(sql,0);
            st.setString(1, name);
            st.setString(2, mgr_id);
            st.setString(3, Loc_id);
            st.execute();
getDBTransaction().commit();
What is the best approach?

Studio Edition Version 11.1.1.2.0

Rognard

Ranjinth,

It is not against the layered architecture, none.

Why not use an approach hybrid?

Create a method of AM service, as you did, but instead of writing your own prepared statement, just manipulate the VO in the method: create a line, set attributes, insert the line.

Tags: Java

Similar Questions

  • Use the state machine to fill cluster

    Hello

    I am trying to create a state machine that is running two States, each State has two items up to a Bundle function and in the cluster. I want the two elements of the State first across, then the second State should run and pass the last two items. Currently, I get only the data of the final State. I have one the vi attached.

    Thank you

    Chris

    You don't actually have a state machine.  What you have is a simple loop, and nothing of what is happening in the previous iterations of the loop is spent in later iterations.

    You must create the cluster in the loop itself and maintatin into a shift register.  Use the bundle by name to update the respective elements of the cluster in each picture of the structure of the case.

  • Tips to remember when using the state machine in queue

    I was able to work through the convert my architecture of State Machine for a BAU, thus eliminating the use of nodes of property/local variables to send data values to my machine of the State, but rather to send through queues.

    I would like some advice/tips on taking to serve perfectly. Especially, "is not to make" things with queues and how to effectively release a queue, etc.. What is the convention when using queues? Thank you!

    V


  • using the statement and pagebox to spend

    I am very new to javascript, but I'm trying to write a small script to provide automation based on the size of the page.

    I know that my current document is one of the cases listed, but I can't get the switch statement below to acknowledge.

    Any help would be greatly appreciated. I use Acrobat Pro 9. Thank you

    function test() {}

    var pSize = this.getPageBox ("Crop");

    App.Alert (pSize, 3);

    {Switch (psize)}

    case '0,612,792,0': //A

    App.Alert ("Page size", 0);

    break;

    case '0,792,1224,0': //B

    App.Alert ("B size Page", 0);

    break;

    case '0,1224,1584,0': //C

    App.Alert ("C size Page", 0);

    break;

    case '0,1584,2448,0': //D

    App.Alert ("D size Page", 0);

    break;

    by default:

    App.Alert ("size of the Page Not Found!", 0); / / do this if all else fails

    break;

    }

    }

    You can try to convert the table to a string using the switch statement:

    var pSize = this.getPageBox("Crop");
    pSize = String (pSize);
    // Now, use switch statement as you have it.
    
  • Merge using the statement

    Version: Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    Hello

    I Merge statement that throws an error that it's an invalid statement, but I do not understand why.

    The statement is:

    MERGE INTO tbs_forecasts_archive tfa
    USING  (SELECT  pub_fc.forecast_id
                   ,pub_fc.last_approved_date
                   ,pub_fc.resource_id
                   ,pub_fc.project_id
                   ,pub_fc.cme_system
                   ,pub_fc.role
                   ,pub_fc.forecast_type
                   ,pub_fc.last_updated
                   ,pub_fc.last_updated_by
                   ,pub_fc.old_forecast_id
                   ,pub_fc.start_date
                   ,pub_fc.end_date
            FROM   published_forecast pub_fc
            INNER JOIN tbs_projects ON tbs_projects.project_id = pub_fc.project_id
            LEFT JOIN tbs_areas ON tbs_areas.area_id = tbs_projects.area_id
            INNER JOIN resources ON resources.resource_id = pub_fc.resource_id
            INNER JOIN tbs_teams ON tbs_teams.team_id = resources.tbs_team_id
            WHERE ( tbs_projects.group_id = :P0_GROUP ) AND
                  ( tbs_projects.area_id = :P86_AREA OR :P86_AREA = 0 ) AND
                  ( tbs_projects.project_id = :P86_PROJECT OR :P86_PROJECT = 0 ) AND
                  ( tbs_teams.team_id = :P86_TEAM OR :P86_TEAM = 0 )
           ) pf
    ON     ( tfa.forecast_id = pf.forecast_id AND
             TRUNC(tfa.baseline_name) = TRUNC(pf.last_approved_date)
           )
    WHEN MATCHED THEN
        UPDATE SET  tfa.resource_id     = pf.resource_id
                   ,tfa.project_id      = pf.project_id
                   ,tfa.cme_system      = pf.cme_system
                   ,tfa.role            = pf.role
                   ,tfa.forecast_type   = pf.forecast_type
                   ,tfa.last_updated    = pf.last_updated
                   ,tfa.last_updated_by = pf.last_updated_by
                   ,tfa.old_forecast_id = pf.old_forecast_id
                   ,tfa.start_date      = pf.start_date
                   ,tfa.end_date        = pf.end_date
    WHEN NOT MATCHED THEN
        INSERT (
                 forecast_id
                ,baseline_name
                ,resource_id
                ,project_id
                ,cme_system
                ,role
                ,forecast_type
                ,last_updated
                ,last_updated_by
                ,old_forecast_id
                ,start_date
                ,end_date
               )
        VALUES (
                 pf.forecast_id
                ,pf.baseline_name
                ,pf.resource_id
                ,pf.project_id
                ,pf.cme_system
                ,pf.role
                ,pf.forecast_type
                ,pf.last_updated
                ,pf.last_updated_by
                ,pf.old_forecast_id
                ,pf.start_date
                ,pf.end_date
                );
    
    

    Can someone explain what's wrong with this statement? It seems that it is a syntax error, but I was not able to find an example that uses multiple tables in select it like that.

    Do I need to provide data and tables?

    Can what additional information I give?

    Thank you

    Joe

    Would be - this pf.baseline_name in your VALUES clause is an invalid reference. TRUNC (pf.last_approved_date) is maybe what you mean?

    Kind regards

    Bob

  • Monitoring the memory usage on iOS using the Stats class

    I was check memory usage on an application I'm developing for iOS using Stats class https://github.com/mrdoob/Hi-ReS-Stats ( http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c3-315cd077124319488fd-7fff.html#WS 948100b6829bd5a61637f0a412623fd0543-8000).

    I added the class Stats to my project and redeployed and, Ouch, reported in Stats memory usage ramp upward (quite slowly) even when there is nothing going on in the application (just displaying a loaded bitmap).

    To try to find the question, I created a project with a test class that extends Sprite with just this single call in the constructor: -.

    addChild (New Stats());

    I have deployed to the device to check that he didn't swallow all of memory.

    But I was surprised to observe the use of the memory to crawl upward and upward (to 5) before kicking in some garbage and takes memory down. I left it running and then he slipped once again more than 7.5 this time before being deported back down to just below 3.

    So 2 questions that I would be grateful any feedback/comments/thoughts on related: -.

    1 is this normal (i.e. memory creeping up when there is nothing else than to the Stats in the project)?

    2 - What is the best way to monitor the memory usage in an application? Good enough stats - is Stats itself causing the memory usage?

    All the best guys!

    See also thread (http://forums.adobe.com/message/4280020#4280020)

    My conclusions are:-

    -If you run an application and let idle, use memory slips gradually upward (probably in memory is used to perform the Calc/refresh the display, etc.)

    -Periodic garbage collection occurs and memory is brought back down

    -This cycle could be more than 5 min.

    Work with your real application and memory will increase and be published much more quickly/regularly.

    -It's probably worth making an initial check running on your desktop computer to smooth out all the initial problems

  • How to use the Multiple selection in ADF faces

    I have, I want to know how to use a multiple selection (ADF select several choices) for updating the database.

    by mentioning your exact jdev version.

    As far as I know he in not possible automatic update select a choice that she returns a list which you must map back to the lines of the table yourself.

    Timo

  • IF / or using the statement

    Hi all had problem to find a solution with a statement label. don't really know how to make this work. so I turn to you guys in the hope that one of you Guru´s know the solution. using funds Bi Publisher plugin for word.
    well heres the problem:


    <? If: (TAG1) or (TAG2)? >
    <? specific tag? > (if there are tag1 or tag2)
    <? end if? >

    need a statement that checks to see if tag1 OR tag2 exist so a specific tag will appear.
    but I don't know how to write it.
    I first thought to do both if statement like this

    <? If: (TAG1)? >
    <? specific tag? > (if tag1 exists)
    <? end if? >
    <? If: (TAG2)? >
    <? specific tag? > (if tag2 exists)
    <? end if? >

    But the problem with this is that if BOTH tag1 and 2 exists then I will have 2 of my specific tags. and that won't look great.
    So, it is possible to write an if STATEMENT or a statement?

    Best regards Magnus


    You statement

    This will check if one is present.

  • Consolidation of multiple columns by using the statement box

    Hello

    I have 4 columns

    Column_A, Column_B, Column_C, Column_D

    I created Column_E IE

    ALTER Table My_Table
    ADD)
    Column_E varchar2 (100)
    )

    Data in columns A - D are either 'Y', ' no or (null)

    What is necessary is the following: if it is a 'Y' in ONE of the columns A to D then place 'Y' in Column_E place in the case "n" in Column_E. This must be done for all the lines of my_table

    Thank you!!!

    Banner:
    Oracle Database 11 g Release 11.2.0.2.0 - 64 bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE 11.2.0.2.0 Production."
    AMT for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    SQL> with test_data as
      2      (
      3      select 'N' a, 'N' b, 'N' c, 'N' d from dual union all
      4      select 'N' a, null b, 'Y' c, 'N' d from dual union all
      5      select null a, 'N' b, 'N' c, null d from dual union all
      6      select 'N' a, 'Y' b, 'N' c, 'N' d from dual union all
      7      select null a, null b, 'N' c, 'Y' d from dual
      8      )
      9  select t.*,
     10      case when instr(a||b||c||d,'Y') > 0 then  'Y' else 'N' end
     11  from test_data t;
    
    A B C D C
    - - - - -
    N N N N N
    N   Y N Y
      N N   N
    N Y N N Y
        N Y Y
    

    Please note that it helps if you provide test data as shown in this example.

  • duplicate group by using the statement

    4 columns in the table named RRID1

    RRI_ID
    USER_ID
    PROCESS_TYPE
    FUNCTION

    don't know how to make this request.

    Need to learn where all the RRI_ID type = "INFO".
    and USER_ID IS DOUBLE for this RRI_ID.

    That's what some of the data looks like to...

    PROCESSTYPE | USER_ID. FUNCTION | RRI_ID

    3668 30287 817 INFO
    3748 30287 817 INFO
    4714 30287 817 INFO
    4875 30287 817 INFO
    4882 30287 817 INFO
    4885 30287 817 INFO
    3748 30288 818 INFO
    4714 30288 818 INFO
    4716 30288 818 INFO
    4882 30288 818 INFO
    4885 30288 818 INFO
    819 30289 3668 INFO
    819 30289 4716 INFO
    819 30289 4875 INFO
    819 30289 4882 INFO
    819 30289 4885 INFO
    3668 30290 820 INFO
    4716 30290 820 INFO
    4875 30290 820 INFO
    4882 30290 820 INFO
    4885 30290 820 INFO
    3668 30291 821 INFO
    4714 30291 821 INFO
    4716 30291 821 INFO
    4875 30291 821 INFO
    4882 30291 821 INFO

    Published by: user11299998 on October 1, 2010 07:21

    Published by: user11299998 on October 1, 2010 07:22

    Published by: user11299998 on October 1, 2010 07:22

    Published by: user11299998 on October 1, 2010 07:22

    Something along the lines of...

    select rri_id, user_id, process_type, function
    from (
          select rri_id, user_id, process_type, function
                ,count(*) over (partition by rri_id, user_id) as cnt
          from rrid1
         )
    where process_type = 'INFO'
    and cnt > 1
    
  • How to use time with the State in MODE Lab machine

    Hello

    I tried to use the state machine with function elapsed time so sequentially, start and stop my code. The arrangement is to start the code for 1 minute then stop for 5 minutes. I have attached the code, the problem is when I place the function elapsed time, exit the while loop it does not, on the other hand when I place it inside the loop it does not work, but it does not give the right signal to move to the next State.

    Could you please take a look at my code and help me solve this problem.

    Concerning

    Rajab

    Rajab84 wrote:

    APOK thanks for your help

    even with the support on start it continues to turn on the case of waiting

    could you please explain the code for me, the use of the Boolean crossing, increment and equality of functions

    Best regards

    Rajab

    Ok.. I have modded the example to stop after 2 cycles. Also recommend that you take the free online tutorials of LabVIEW.

    1. run the vi. case statement goes to 'initialize', shift registers are initialized to their constants. GoTo 'wait '.
    2. "start" = false, stay in the current state. If true, switch to the "1 min" case
    3. "Reset timer set off with True of the shift register (counter starts at zero). time elapsed "= false, stay in the current state (1 min). If true, goto "5 min" case
    4. "Reset timer set off with True of the shift from the previous case register (counter starts at zero). time elapsed "= false, stay in the current state (5 min). If true, goto "1 min" case. Also, bool crossing is the search for "true-false" function compares '5 min' to add the number of cycle.
    5. Once the number of cycles reaches 2, stop all loop...
  • To run the State and asynchronous control pending...

    I have a VI that I call asynchronously.

    When I run it, I record the refnum for her and watch her status to see if it stops running. At some point, the asynchrounous VI will run the pending execution. How can I see by using the State of the VI property node. I assumed, apparently incorrectly, that when a Subvi is "waiting to run" that he would be in a State of execution other "Running". Is there something else I should be looking? What works here?

    I'd certainly prefer this solution rather than an alternative such as send a user or view event since it places no restriction on the Subvi (i.e. the subvis connector plan).

    Thank you!

    As I do this is to use asynchronous Start using the call and Collect Call option.  To say that if the VI has finished, I use a wait on node for asynchronous call with a short timeout - if he stopped (returned), then the wait will succeed without error, as if she is still underway, the wait will be timeout, throwing an error I can trap and clear.  My routine of waiting and then returns a Boolean to indicate whether the asynchronous routine is back.  If so, I can stop the asynchronous routine using a target Abort VI.

    In a fairly large project in real time, I had about 5-6 asynchronous 'loops' running in parallel, completely detached.  When I was ready to stop, I used a VIG who has been wired for their stop indicator.  In my hand, I then called the wait routine on all my routines in a loop until they call returned as "stopped", then I really 'arrested' them by calling the option "Stop" (Abort VI) on each of them.

    Bob Schor

  • For the State Machine logic makes me Mad, ideas?

    Hello

    I am a complete newbie to Labview and up to the help of kind people on the forum and tutorials tips, State where I implement a state machine.  However, I can't it behave using logic.

    What I try to do is to test the relay using an automated test procedure.

    The procedure takes the following measures:

    1. a card reader and transistor NI9472 DO turns the relay power via the power of the coil (needs of the variable time period). (It's OK)

    2. account of how can cycles the relay contacts worked, it will easily exceed 100,000 cycles. (It's OK)

    3. every 10 cycles (new variables), the contacts are held closed, load circuit "15A in the state machine" (the current relay is switching, which will be 15 a at 30V) is turned off.

    4. While the State of 15A is off, I need to switch to 'State of 1' and the 'State of the measure' , that it allows the measure to take.

    5. Finally, the "State measure and the"State of A 1"must be turned off and the"15A State switched back on .

    6. this process continues for another 10 cycles and repeats.

    I tried to do by using the States and the logical selection function for different States, where she part works, it does not seem to flow completely.  I'm I missing logic.

    Hoping someone may be able to help, thanks

    Andy

    I really didn't thing you want to be returning this Boolean value in all States.  You should probably also have a different evolution register for each line of output.  Then you simply adjust those that you need to.

  • When to use the structures of the event

    I wrote several applications using the state machine architecture.  Generally, these applications have two buttons (I created), a race and give up.  The abort button interrupts the guide and goes to a State of inactivity which loops until the run button is selected.  One thing that I don't like, my programs ending up with one or more local variable for the Cancel button.

    (1) should I use structures event for these types of programs?

    (2) is a program of event also structure a state machine?

    Why would you need local varables for the button abandon? Do simply lock action so it resets automatically.

    If your loop by turning in any case (e.g. for updating views) migh ask both controls. Any necessary event structure.

    ggress1 wrote:

    (1) should I use structures event for these types of programs?

    (2) is a program of event also structure a state machine?

    The event structures are mainly for the manipulation of interaction of the user on the front panel. I encourage you to learn more about the structures of the event so you can make an informed choice on the best architecture of code for a particular programming problem. Maybe you should show us some of your code so that we can decide by using the event structures should improve things.

    A program with event structures is generally much less forgiving of the rookie mistakes. Used properly, they can easily lock your program.

  • Related to the States of the objects in Captivate 9 video tutorial

    Are there any good video tutorials that explain how to use the States of objects in Captivate 9?

    Not a video, but I blogged recently about States in the slide objects &: & slide in 2016 with Captivate 9 - Captivate blog

Maybe you are looking for

  • Upgrade to 3.0.19, failed and delete the .exe. Downloaded 3.6.3, can I ask on an old, keep old profiles?

    I have received messages that my version was not taken in charge, to upgrade to 3.0.19. The upgrade has failed and the old Firefox.exe deleteda; now no browser. I downloaded the 3.6.3, can I install on the old version, corrupted and use my old profil

  • HD and SD streaming

    If I buy a HD movie, can listen to it in SD? My network is slow, but when it is upgraded, I want to be able to broadcast in HD.

  • Pavilion s3100n: restore to factory so long or frozed

    I just bought a HP recovery system support, is not a copy of windows vista, everything I download off the visa of windows free download off this website.i my old hard drive to another hard drive repace used out of ebay.found he was'nt my mother or my

  • code error 646 Windows update

    I install 14 update of windows, but he met the error 646 code (KB978382) (KB973709) (KB969604) (KB57789) (KB969559) (KB969613) (KB972581) (KB974234) (KB976321) (KB978380) (KB976416) (KB980729) (KB974561) (KB981715) .i already try to disable my norton

  • no graphic device found

    I used WinZip systems Utilities Suite to clean my computer.  Now when I try to play games that I have played, I get a message that says no: "no suitable graphics devices found"... Help!