Question about  how to extract CPU time

Hello,
I want to use JAVA program to extract my CPU timestamp or time span between two event, e.g between message transmitting and receiving.I don't know which core API can be used to realize the precision of nano second.
are there any API, which can count the CPU cycles in JAVA?
My platform is Linux (ubuntu)
Thank you in advance

kajbj wrote:
webscape wrote:
*(y-x)* should be your answerNo, that will not give CPU time.Also, those methods are (relatively) extremely slow which can, in itself, skew the results. You should be using the nano timer for this kind of thing.

Similar Messages

  • New MacBook Air: questions about how to network (AirPlay, Time Capsule, Apple TV, etc)

    Hi guys,
    I am the new owner of a MacBook Air 13" and I've decided to upgrade my home network. Can one of you please help me identify the additional products I need to purchase in order to achieve my desired goals?
    Here is what I want to do:
    * I want to have a large, local, networked hard disk where I can store thousands of photos (iPhoto library) - looks like time capsule or possibly Airport Extreme would be good here
    * I want to access this iPhoto library from my MBA, MBP, and iPad 2. The photos will not be stored locally on any of these devices. Is this possible, and would I experience significant slowness due to this setup? Basically i want a local cloud with massive storage.
    * I could also be tempted to store my iPhoto library in Dropbox but I wonder if the laptops etc would support this? Also this much storage could get pricey.
    * I would like to stream music from services like Pandora and Spotify to my home theater system, which has all kinds of optical / coponent connections (Denon receiver). Ideally I'd like to do this from any of my devices including iPad and even iPhone. I do not use iTunes.
    * I would like to stream content from my devices to my TV including photos and videos, as well as basic mirroring functionality. Given I currently stream Netflix etc through Xbox this is the least important of all my desires. My tv has things like hdmi connections.
    So guys do you think I can do this? Particularly the iPhoto part. Im really looking for a seamless experience in accessing my photos from any laptop.
    Any tips on exactly what products I need to buy would be greatly appreciated. 

    Pappasbike, welcome to the discussions!
    "Now my confusion comes from reading about setting the TC in bridge mode."
    "The TC is only a foot or two way from the AEBS"
    Last item first....if the TC is this close, it might make more sense to connect the two devices together with an ethernet cable. (Always use ethernet connections when possible for faster speeds and more reliable connections.) You would connect one end of the ethernet cable to one of the LAN ports on the Extreme and the other to the WAN port on the Time Capsule.
    Bridge Mode....You only want one router doing DHCP and NAT and that is being done by the Extreme according to your post. Since the Time Capsule is also a router, you would want to configure it in Bridge Mode so that you will avoid IP conflicts and double NAT errors on your network. Do this as follows:
    Open Airport Utility and click on Manual Setup for the Time Capsule.
    Click on the Internet icon at the top of the pane.
    Now look for the "Connection Sharing" setting near the bottom of the pane. Select "Off (Bridge Mode)
    Click Update to save your new settings.

  • Hello! I have a huge question about how can I get connected my iphone 4 with my car Is there any opption on find my car application? I have a Volvo xc60 and I want to be connected all the time with my iphone. Can I do that?

    Hello! I have a huge question about how can I get connected my iphone 4 with my car Is there any opption on find my car application? I have a Volvo xc60 and I want to be connected all the time with my iphone. Can I do that?

    Hello. I can say that you have a quite strange „huge question”… It’s non-sense to stay connected with your car which is hundreds miles away. Unless…
    I have a theory. You don’t want to controll your car, you want to controll somebody who is driving the car. Volvo XC 60 is a nice family car, usually used by married men between age of 35-45, probably with small children, so it’s very unlikely that you want to controll your teanage kid, mainly because probably even if you would give him/her to drive the car in the neighborhoud, I don’t think that he/she would be „several hundred miles away”…  If your child is not young teneage anymore, and he/she has his/her own life, but you want to control him/her, that is sick… So I am convinced that you want to controll your husband who probably travelling often! Am I wright?
    Isnt’t nice at all! Would you like if you would be monitorized in such way? I bet you don’t!
    Anyway, iPhone is smart, you can use for many things, but come on, you really were thinking that there is such kind of application???
    What could you do it's to put in the car a GPS survelling system, however I don't think that you could do it without your husband knowledge, otherwise he won't be able to start the engine...

  • How to extract execution time of a step

    how to extract execution time of a step ?
    This step calls another sequence, and
    I want to know how long it take to execute that seqeuence.
    I need this information during run time, not in the
    report.
    thanks.

    Hi,
    You could try.
    Enable the Record Result for the step in question.
    This will allow you to extract the TotalTime.
    Then you could use the RemoveElements(Locals.ResultList,"[0]",1) - this assumes you have only logged one result. This is the same as not recording results for that step.
    Otherwise you will have to workout the time yourself by calling the API Execution.SecondsExecuting() - API Execution.SecondsAtStart().
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • A few questions about how ZPM works.

    We have patch management (in ZCM 11.2.2), but honestly don't use it much. I have a few questions about how it works that might make me use it more, if I understand it more.
    If I deploy a patch (or a set of patches), it creates a bundle for that deployment. That bundle seems to include actions that deploy the actual patch bundles (correct?). Do I have to recreate a new deployment bundle every time I want to push a new patch? i.e. If I push a Java update, and a month later, a new one comes out, do I build out a new bundle with the new patch in it, or do I modify the old one?
    Once the patch is deployed, can I safely delete that deployment bundle, or should they just pile up?
    Is there a way to "auto-approve" patches? Lets say I always want a group of machines to have the latest Adobe Flash Player patches. Can I set up ZPM to automatically cache and push the latest patches for a specific product, or do I have to manually remediate each patch? (I'm thinking of how MS's WSUS does "auto-approval")
    I see most packages aren't cached in list, but occasionally, a patch is cached without me touching it. Why? Can I change what gets automatically cached?
    Thanks for any help/answers you can provide.
    -Adam

    Originally Posted by adrockk
    We have patch management (in ZCM 11.2.2), but honestly don't use it much. I have a few questions about how it works that might make me use it more, if I understand it more.
    If I deploy a patch (or a set of patches), it creates a bundle for that deployment. That bundle seems to include actions that deploy the actual patch bundles (correct?). Do I have to recreate a new deployment bundle every time I want to push a new patch? i.e. If I push a Java update, and a month later, a new one comes out, do I build out a new bundle with the new patch in it, or do I modify the old one?
    Once the patch is deployed, can I safely delete that deployment bundle, or should they just pile up?
    Is there a way to "auto-approve" patches? Lets say I always want a group of machines to have the latest Adobe Flash Player patches. Can I set up ZPM to automatically cache and push the latest patches for a specific product, or do I have to manually remediate each patch? (I'm thinking of how MS's WSUS does "auto-approval")
    I see most packages aren't cached in list, but occasionally, a patch is cached without me touching it. Why? Can I change what gets automatically cached?
    Thanks for any help/answers you can provide.
    -Adam
    For #1, (assuming you're not using baselines), you would check the new version of the patch (vulnerability) and do a new deployment.
    #2 - once you're satisified that the machines are deployed (or the best to your ability) you can delete the DEPLOYMENT package. It doesn't delete the actual vulnerability bundles to my knowledge. That's why it's a good idea to name your bundle deployments with something meaningful, IMO (and maybe include a nice desription).
    #3 - currently I don't believe this is possible. I know you can probably configure it to auto-download the patches, but not auto-deploy everything. Given the propensity for software to wreck other things (hello MS .NET patches), this is probably not a good idea. At least I'd never auto-download and auto-deploy any patches without testing them first, and certainly take my servers a little more cautiously than my workstations.
    #4 - I think you can configure what's cached, but I could be wrong.
    I know there's a lot of improvements coming in the pipeline, and it doesn't hurt to "vote" for your enhancements via the enhancement system (more work for Shaun--haha)
    --Kevin

  • Round trip workflow with proxies between Premiere and AE / a more general question about how these programs work?

    Hi all,
    I'm new to editing with proxies in Premiere and have some questions about how to handle the relationship with After Effects. Say I have a rough cut (with proxies) and I want to send it to AE to do some effects. The simplest thing to do seems to be to replace the proxies with the originals in Premiere, send the project to AE and do my thing. But if I then want to send the project back to Premiere, it will involve the original files, which are too machine-intensive for me to edit. In theory, it seems like there should be a way to send the project with original footage to AE, do effects, send it back to Premiere, and then replace it with proxies to do further editing while retaining the effects.
    This leads to a confusion about how AE works. When I do an effect, am I correct in assuming that it does nothing to the original file? If that's the case, it seems like it shouldn't matter (in the editing stage) what file AE "applies" an effect to (proxy or original). But I feel like there's a hitch in this workflow. The same question could also be asked about going back and forth in Speed Grade.
    Perhaps there is no real answer to this and the best option is to save effects and grading for after I have picture lock, but sometimes that's not entirely possible or convenient, etc.
    Hopefully this makes some sense—It's a little hard to explain.
    Thanks.

    Hi Mark,
    Here are the specific sections of the manual that should give you the best explanation regarding the Check out/in workflow for FCP projects in Final Cut Server:
    Check out:
    http://documentation.apple.com/en/finalcutserver/usermanual/#chapter=7%26section =5
    Editing:
    http://documentation.apple.com/en/finalcutserver/usermanual/#chapter=7%26section =6
    Check in:
    http://documentation.apple.com/en/finalcutserver/usermanual/#chapter=7%26section =7
    -Daniel

  • V$osstat and V$SYS_TIME_MODEL - how to get CPU time from instance

    Hi there !
    I have a function osstat, which take stats from the os using v$osstat (credits for the procedure to a person, I regret to say, that I cant remember his name). But since we have 9 databases on the same server (and we dont have access to the server os itself (outsourcing stinks), we often would like to know more about cpu, waits etc. And one of the procedures we use is the osstat.
    I have tried to combine it with V$SYS_TIME_MODEL in oder to se how much of the OS CPU time comes from the instance I am on at the moment, but I'm not able to figure out how to do it exaclty.
    This is my code:
    DROP TYPE OSSTAT_RECORD;
    CREATE OR REPLACE TYPE osstat_record IS OBJECT (
      date_time_from TIMESTAMP,
      date_time_to TIMESTAMP,
      idle_time NUMBER,
      user_time NUMBER,
      sys_time NUMBER,
      iowait_time NUMBER,
      nice_time NUMBER,
      instance_cpu_time NUMBER
    DROP TYPE OSSTAT_TABLE;
    CREATE OR REPLACE TYPE osstat_table AS TABLE OF osstat_record;
    CREATE OR REPLACE FUNCTION osstat(p_interval IN NUMBER default 5, p_count IN NUMBER default 2, p_dec in number default 0)
       RETURN osstat_table
       PIPELINED
    IS
      l_t1 osstat_record;
      l_t2 osstat_record;
      l_out osstat_record;
      l_num_cpus NUMBER;
      l_total NUMBER;
      l_instance NUMBER;
    BEGIN
      l_t1 := osstat_record(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
      l_t2 := osstat_record(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
      SELECT value
      INTO l_num_cpus
      FROM v$osstat
      WHERE stat_name = 'NUM_CPUS';
      FOR i IN 1..p_count+1
      LOOP
        SELECT systimestamp, sum(decode(stat_name,'IDLE_TIME', value, NULL)) as idle_time,
               sum(decode(stat_name,'USER_TIME', value, NULL)) as user_time,
               sum(decode(stat_name,'SYS_TIME', value, NULL)) as sys_time,
               sum(decode(stat_name,'IOWAIT_TIME', value, NULL)) as iowait_time,
               sum(decode(stat_name,'NICE_TIME', value, NULL)) as nice_time
        INTO l_t2.date_time_to, l_t2.idle_time, l_t2.user_time, l_t2.sys_time, l_t2.iowait_time, l_t2.nice_time
        FROM v$osstat
        WHERE stat_name in ('IDLE_TIME','USER_TIME','SYS_TIME','IOWAIT_TIME','NICE_TIME');
        select value/100000
        into l_t2.instance_cpu_time
        from  V$SYS_TIME_MODEL
        where stat_name = 'DB time';
        l_out := osstat_record(l_t1.date_time_from, systimestamp,
                               (l_t2.idle_time-l_t1.idle_time)/l_num_cpus/p_interval,
                               (l_t2.user_time-l_t1.user_time)/l_num_cpus/p_interval,
                               (l_t2.sys_time-l_t1.sys_time)/l_num_cpus/p_interval,
                               (l_t2.iowait_time-l_t1.iowait_time)/l_num_cpus/p_interval,
                               (l_t2.nice_time-l_t1.nice_time)/l_num_cpus/p_interval,
                               ((l_t2.instance_cpu_time-l_t1.instance_cpu_time)/100));  --- >>  Should I divide by no of cpus here as well???  Or ???
        l_total := l_out.idle_time+l_out.user_time+l_out.sys_time+l_out.iowait_time+nvl(l_out.nice_time,0);
        if l_out.user_time > 0 then
           l_instance := (l_out.instance_cpu_time*100)/l_total;   ->> instance in percent of the total cputime
        else
           l_instance := 0;
        end if;
        if i > 1 then
        PIPE ROW(osstat_record(l_t1.date_time_to, systimestamp,
                               trunc((l_out.idle_time/l_total*100),p_dec),
                               trunc((l_out.user_time/l_total*100),p_dec),
                               trunc((l_out.sys_time/l_total*100),p_dec),
                               trunc((l_out.iowait_time/l_total*100),p_dec),
                               trunc((l_out.nice_time/l_total*100),p_dec),
                               trunc(l_instance,p_dec)));
        end if;
        l_t1 := l_t2;
        sys.dbms_lock.sleep(p_interval);
      END LOOP;
      RETURN;
    END;
    /I get ie a USER CPU Time of 15% fo a given interval of 5 mins - and a cputime for the instance of 50 - and others are 5% and 1%.
    My brain has stopped working now .... I'm stuck
    Mette

    mettemusens wrote:
    Hi there !Duplicate thread:
    Re: v$osstat and V$SYS_TIME_MODEL question
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • How to increase cpu time for a job

    We have a application which submits a scheduler job. The job parses a blob and inserts rows into a table. It was running slow . On checking the scheduler tables I found out for actual time of 2 hours the job is taking cpu time of less than 2 minutes.
    Can anybody help us with any idea to increase the CPU utilization by around 4 times so the job finishes in 30 minutes
    Thanks
    Saikat

    Hi,
    How long does it take when you run the same action that the job is running from sqlplus ?
    This looks like more of an Oracle tuning question than a Scheduler question. You might get better answers if you gave more info about the pl/sql code being run and posted this to the general pl/sql forum here
    PL/SQL
    You can also try general PL/SQL profiling tools to see what statements in your code are taking the longest while to run e.g. AWR and ADDM if you have licenses for them.
    Hope this helps,
    Ravi.

  • I have a question about how to contact HR with e-mail.

    I read the rules about anything about HR is not allowed, but I also read to contact HR directly, so I won't ask anything further here. My question is, how? I searched for an e-mail, but all I have been able to find is a phone number I can't ring since I have no phone, just internet. Thank you.

    Hello Dennis,
    If you're a Best Buy or Geek Squad employee and do not have access to a telephone, then two alternative contact options exist for you: speak with your direct supervisor or use the My HR app within Employee Toolkit. If you are not a Best Buy employee, however, our HR support team will not be able to assist you -- these contact channels are for employee use only.
    Thank you for your understanding, as well as for taking the time to post.
    Aaron|Social Media Specialist | Best Buy® Corporate
     Private Message

  • A question about restoring from an old Time Machine backup

    My computer has been acting very slow and freezing frequently lately.  The spotlight background processess keep hogging the processor, and
    It keeps getting catalog b-Tree corruption.  I've already done one complete reformat of my drive and a restore from a time machine backup hoping it would fix things, and that didn't work.
    I tried a complete reinstall and used the migration assistant to move all my files and settings from my time machine back over to it.
    That worked for about a week, then had b-Tree corruption that could only be fixed with disk warrior.
    I was suspecting a hardware problem, but I have done thourogh tests of my Ram with memtest from single user mode, and a disk surface scan with Tech Tool Deluxe.  Everything checks out.
    I am thinking there is some corrupt system file or setting that is getting reinstalled from my Time machine backup that is messing things up.
    This all is a leadup to my question:
    I would like to try restoring from a much older Time Machine back up (6 months ago or so before I started experiencing problems). 
    If I do that, can I still use Time Machine to restore individual files and directories from later backups?
    I'd like my system settings and applications to be from six months ago, but my desktop files and documents to be from my most recent backup.
    Thanks,
    -Matt

    Yeah, I usually check the FAQs before posting a question.
    They do talk about how to restore from an older back up, but not about what happens to your newer files once you have done it.  They also talk about accessing files from another computer's time machine backup, but its not clear if that would work on a different fork of the same machine. 
    I may just have to learn from experience, but I don't want to risk losing any data.
    I do recommend time machine though.  Its saved me several times.
    If anyone else has experience with this let me know.
    Thanks,
    -Matt

  • Question about how the Robocopy /B switch works...

    I've been experimenting with robocopy recently, and most switches seem self explanatory for the most part; although I have a question about the /B switch.
    The help says the following:
    /B :: copy files in Backup mode.
    I've checked multiple forums and websites to try and elaborate on this a little more, and from my understanding this switch enables backup mode that essentially gives the ability to change the acls of a file/folder when the account running robocopy does
    not have sufficient privileges, to perform a successful copy.
    My question is, when the acls are changed when using this "backup mode" switch, with the /copyall switch, will the file still retain the same user access that it originally had - or does it change all of the security settings?
    I'm hoping it will somehow change the security settings, create a copy, and retain the same acls as the original - so users can still access necessary files.
    Can someone please explain how this "backup mode" works?
    Thanks in advance.

    This is a very useful thread with a lot of hostility in it.
    I have to agree with Jonathan and hazymat: there are few other forums that will discuss the exact function of /b switch, the TechNet article just says "copies in Backup Mode" (I have the article bookmarked), and when doing a google search, THIS page comes
    up as the top result! Kinda difficult to tell people they should go search, when you are the exact destination of that search, isn't it? ;)
    No offense to anybody working hard to help out here, but this is why sites like Stack Exchange will overshadow every traditional tech forum very soon. More concise question/answer format, more civil, and they actually encourage old questions developing new
    answers! All q&a is cataloged for future reference. Their focus is on being a 'resource'.
    The negativity here is unfortunate, you guys have great potential to be a very helpful resource for people. Who are you trying to be, the guys with all the answers, or the guys who say "get out of here, your answer isn't in here. Go search for it."?
    Regardless, many thanks to jrv! for helping me with my robocopy batch SCRIPT which I just used to create an automated backup! Take care boys. And yes, I just bumped your old-old thread.
    Unfortunately I think you miss the point.  RoboCopy is an application.  It is not a script.  This is a scripting forum.  Many people come here nd never read the forum guidelines and do not ask script related questions.
    The /b switch is documented in RoboCopy help.  Of course it assumes the reader is a trained Windows tech and knows what backup mode is.  It is used by nearly all backup software when backing up a live system..
    ¯\_(ツ)_/¯

  • Another one question about how to download applet (not using external tool)

    Hi
    i write tool for downloading applet on card. I use apdu trace from NXP eclipse plugin as source of information and i read also about cap-file format in Java Card Virtual Machine specification. And i have questions about data transferred by LOAD command.
    As example - from apdu trace i see that transferred data are "C4820E33 DATA1 DATA2". Full length of transferred data is 0x2EE2.
    C4 - OK, this is "Load File Data Block" tag as specified in Global Platform
    820E33 - OK, this length of tag, =0x0E33
    DATA1 - sequence of cap-file components: Header.cap, Directory.cap, Import.cap, Applet.cap, Class.cap, Method.cap, StaticField.cap, ConstantPool.cap, RefLocation.cap. Length of DATA1 is 0x0E33, i.e. DATA1 = 'C4'-tag value.
    DATA2 - sequence of two cap-file components: Descriptor.cap and Debug.cap. These components are out of 'C4'-tag.
    the questions mentioned above... here they are:
    1. Global Platform does not define any data in LOAD command except 'E2' and 'C4' tag. Why DATA2 is transferred out of any tags?
    2. Whether the sequence of cap-file components is important? i.e. Can i load Header.cap, Directory.cap etc. in other order than i see in DATA1 field from apdu-trace?
    3. Debug.cap seems to be optional component. And what about Descriptor.cap component? Need i load it on card?

    666 wrote:
    1. Global Platform does not define any data in LOAD command except 'E2' and 'C4' tag. Why DATA2 is transferred out of any tags?Because the components are either optional or only required when communicating with a JCRE that has debugging capabilities. I assume you ran the project in JCOP Tools in debug mode against the simulator? If you did this against a real card it would fail as it does not have an instrumented JCRE capable of debugging code. You could try running the project as opposed to debugging to see the difference.
    2. Whether the sequence of cap-file components is important? i.e. Can i load Header.cap, Directory.cap etc. in other order than i see in DATA1 field from apdu-trace?Yes it is. It is defined in the JCVM specification available from the Oracle website.
    3. Debug.cap seems to be optional component. And what about Descriptor.cap component? Need i load it on card?No, it is optional and is not referenced by any other CAP file component.
    Cheers,
    Shane

  • How shall i do it ? Complex question about how to use the airport express or time capsule ?

    Hello All,
    Right now i have an access point:
    1/ A mercury router (cheap and old)
    2/ Airport Express
    Do you advice me to use it to replace my cheap old router (mercury) or to pair it with this main old router ? (however i tried to without any success)
    3/ Time Capsule
    Can i use it to relay the signal from the Airport Express to extend the range  of the wifi?
    Can i use it to stream music to my B/W M1 speakers directly ? (I will connect by USB the BW M1 to the time capsule) and would like to be able to play music this way. Is this in anyway possible ?
    Many thanks for your reply !

    ok, i might be wrong but here goes:
    you should attach your modem to your time capsule: your time capsule will act as not only your time machine but also your main wireless transmitter.
    you set it up using "Airport Utility" which is inside the "utilites" folder, which is inside your applications folder.
    this connects your mac wirelessly to the internet.
    to stream music to your speakers you then set up the airport plug to (a) join the existing network (which you set up on the time capsule) and then (b) set it up to stream music to your speakers. again, this is done using "airport utility". do it AFTER you have set up the time capsule.
    you will then be able to use itunes to stream music to your speakers. from itunes on your computer you will be able to chose from the bottom right hand side of the window whether you play the music on your computer or wirelessly into your B+W speakers...
    some notes:
    1. you won't be able to connect the airport plug by USB to your speakers as the airport plug doesn't have a USB output. It has only analogue and optical.
    2. although your time capsule has USB you cannot stream music into it or through it. there's some basic guidance here:
    http://www.apple.com/wifi/
    3. you may find that the sound quality [if you are playing apple lossless files or wav files) isn't as good as if the speakers were connected directly to your mac via USB.  this should be especially noticable because your speakers are so good!
    if the music you play is only mp3 or the stuff purchased from itunes then it shouldn't make too much of a difference.
    4. keep an eye out on the B+W website: there may come a time when you won't even have to use the airport plug, and you will be able to stream music straight to the speakers. i know that B+W have just done that with the new Zepellin speaker that they make.
    hope this helps...

  • Question about how not to insert the same row twice

    hello everyone
    i have two tables
    table employee_list
    employee_id
    employee_name
    employee_num
    employee_date
    and table employee_form
    employee_id
    employee_name
    employee_num
    employee_date
    table employee_form should contain the exact data like employee_list .
    if there are missing data i'm inserting it to table employee_form_miss(missing).
    now i have a probelm cause the compair between the two table,take place
    more then just one time.now if there are still missing data i don't want that to table employee_form_miss will insert the same data that already exist in this table.
    i've been thinking about constraints table employee_form_miss(employee_id
    employee_name
    employee_num
    employee_date).
    but i think it will be a wird way to handle this because i will do an insert
    and then what rollback? or delete?
    please help me how to manage this
    thanks in advance.

    hello everyone
    i have two tables
    table employee_list
    employee_id
    employee_name
    employee_num
    employee_date
    and table employee_form
    employee_id
    employee_name
    employee_num
    employee_date
    i'm using an embedded sql in cobol program
    DECLARE AA CURSOR FOR
    select a.employee_name ,a.employee_num,a.employee_date
    from employee_list a
    WHERE a.employee_date = :employee-date
    and NOT EXISTS
    (select null from employee_form
    WHERE employee_name =a.employee_name and
    employee_num = a.employee_num and
    employee_date = a.employee_date )
    i'm doing open and fetch to the cursor.
    and loop over the sqlerrd(3) result in order to insert them to the employee_form_miss table
    insert into employee_form_miss (employee_name,employee_num,employee_date)
    values (:employee-name,:employee-num,:employee-date)
    the employee_id in table employee_form_miss there is a trigger which
    Increment the sequence by 1 for each row that we insert.
    so my question was that if i'm doing a constraint, so still i have to do
    an insert and then if there is a constraint to do rollback or delete
    from duplicate row. is there a better way to manage this ?
    thank you

  • Some questions about how to change scenes

    i have something like the following:
    fxml (view/main/MainMenu.fxml):
    <Scene fx:controller="view.main.CtrlMainMenu" xmlns:fx="http://javafx.com/fxml" stylesheets="view/main/main.css">
        <GridPane xmlns:fx="http://javafx.com/fxml" alignment="center" id="backgorund" hgap="10" vgap="10">
            <!--other panes -->
            <VBox spacing="8" GridPane.columnIndex="0" GridPane.rowIndex="1">
                <Button text="Start" onAction="#Start"/>
                <Button text="Options" onAction="#Options"/>
                <Button text="Exit" onAction="#Exit"/>
            </VBox>
        </GridPane>
    </Scene>main loop (cotroller/main.java):
    public class main extends Application{
        public static void main(String[] args){
            launch(main.class, args);
        public void start(Stage stage) throws Exception{
            stage.setTitle(CtrlLanguage.get(CtrlLanguage.TITLE));
            CtrlMainMenu main = new CtrlMainMenu();
            Scene scene = main.main();          //don't know how to make Scene scene = (Scene)FXMLLoader.load(getClass().getResource("MainMenu.fxml")); work on here since MainMenu.fxml is in view/main while the main class is in controller and ended up putting CtrlMainMenu in the view although is not very correct
            stage.setScene(scene);
            stage.setWidth(1080);
            stage.setHeight(720);
            stage.show();
    }view controller (view/main/CtrlMainMenu.java):
    public class CtrlMainMenu{
        //other buttons actions
        public Scene main() throws Exception{
            return (Scene)FXMLLoader.load(getClass().getResource("MainMenu.fxml"));
        @FXML protected void Start(ActionEvent event){
        @FXML protected void Options(ActionEvent event){
        @FXML protected void Exit(ActionEvent event){
            System.exit(0);          //is there any other way to finish the program than using a system.exit?
    }got few questions currently:
    1. i'd like to be able to keep using CtrlMainMenu for other buttons while the ones that appear there go to the main (since will be reusing those classes from other scenes)
    tried adding fx:controller on panes instead of the scene, but it doesnt work at all (it crashes) else directly in CtrlMainMenu change the scenes of the stage, but then, i have to send the stage to every controller i use? (or how do i know the stage of the scene?)
    and in the case of options, i'd like after done, go back to the previous scene, is that possible? if so, how?
    2.if i want to implement languages, how do i do to change the text? tried with setText() but depending on where do i put it, it crashes, so dont know where do i have to put it
    3.im doing a game that may have different number of players, so, is there some way to erase/hide/add data from a gridpane with fxml?

    1. ok, found the way to change scenes, with this way:
    @FXML protected void Start(ActionEvent event) throws Exception{
         Node node = (Node)event.getSource();
         Stage stage = (Stage)node.getScene().getWindow();
         Scene scene = (Scene)FXMLLoader.load(getClass().getResource("../view/main/MainMenu.fxml"));     //this is just an example, will change to go to another scene
         stage.setScene(scene);
         stage.show();
    }but now i have another problem, when i click on the button the stage scene is changed, but the scene is transformed to a very small one at the top left (the size seems the same as when i dont put the set width/height on the stage when creating it), the stage size remains the same, and when i resize the window, it gets "repaired"
    the options, i thought on using a pane over the current pane so this way instead of going back would be just removing that new pane, would that work well?
    2. found about languages that is by using <Label text="%myText"/> and java.util.ResourceBundle but don't know how to use it, can someone provide me an example, please?
    3. still haven't looked on it...

Maybe you are looking for