How can I count a method executed numer of times.

Hi,
I want to count that a method executed particular no.of times. If it crosses N no.of times then i should print the count and i should reset the count to zero.
I have tried but i havn't get any idea to do it....Could you please give me some ideas to do it....
-Thanks in Advance

Thanks for reply....my requirement is...suppose i have a code with me...front end sends requests every time...if my code executes the request properly(Eg., a simple transaction) then it goes fine...if my code gets exceptions then i need to send a mail to particular persons...
It is fine till now.....But i should not send mails each and every time.....If my code rises exceptions continously some N no., of times within 5 minutes then i need to send mail.........
I hope you understood my requirement....I have tried for this one.....But I am not getting the solution....

Similar Messages

  • How can I find an SQL executed and finished time?

    Hi,
    Could you please help me I would like to learn started and finished time for SQLs?
    If is it possible?
    db version: 9.2.0.8
    thanks and regards
    Edited by: OracleADay on May 12, 2011 4:23 PM

    In what term you are asking give little more description
    If in term of query executed last time then this link will be helpful
    http://forums.oracle.com/forums/thread.jspa?threadID=927452

  • How can i count no rows in my database table

    plz tell me how can i count no of rows in my database table with[b] ResultSet object

    Hi ! hope this code helps you .
    We can use the count(*) to get the total no of records in the table ad then access it through the getString method .
    import java.sql.*;
    public class JdbcTest
         public static void main(String [] args ) throws Exception
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              String DBURL = "jdbc:odbc:mydsn" ;
              Connection conn = DriverManager.getConnection(DBURL);
              Statement st = conn.createStatement();
              ResultSet rs = st.executeQuery("select count(*) from table1");
              rs.next();
              System.out.println("total rec = " + rs.getString(1));     
    Cheers !

  • How can I count the participants' number in TextChatApp? (using SharedObject, FMS)

    Hi all.
    How can I count participants' number?
    If the 3st user enter the room, the 3st user have to know that how many users are in the room.
    How do I know how many users are in the room?
    Thanks in advanced.
    Kevin.

    You have server side hooks for connections coming in or being closed (including here custom code for server disconnecting users for idle purposes).
    you need to keep track of the connections I don't remember now what FMS offers out of the box. Let's assume not much.
    When connection is coming in you can choose to accept or reject it. When you accept a connection you need to add it to your existing connections array or whatever data structure you use to keep track of them. Also you need to iterate to all connected users (clients) and call a custom method "userJoined()" on them to notify that a new user has joined.
    When a user leaves you need to remove the user from the collection and also notify that it left.
    on wowza you have stuff like :
    private HashSet();
    public void onConnect(IClient client, RequestFunction function,
                AMFDataList params) {
    public void onDisconnect(IClient client) {
    public void onConnectAccept(IClient client) {
        _connectedClients.add(client); 
        sendUserJoined();
    @param client
        public void onConnectReject(IClient client) {
             _connectedClients.remove(client); 
            sendUserLeft();
        public void sendUserJoined(String userName)
            Iterator it = _connectedClients.iterator();
            while (it.hasNext()) { 
                IClient each =  it.next();
                    each.call("userLeft", userName);
    FMS has similar hooks. This is simplified but you have a rough idea. You can call clients with no parameters and then is up to client so call back for updates to the server if interested. You need to implement "userJoined" and userLeft client side also.
    C

  • How can I count time with labview7?

    Hi
    How can I count time with labview 7 and NI-DAQmx like I did with labview 6.1 and "count time-easy.vi" (count event or Time.vi).
    I have a 6025E and labview 7.0
    Thanks

    I am not sure what you want to do or why..
    ... but here goes (some suggestions)
    If you want to count the time between two events, you have a choice, you may use the Tick Count. Inisitalize it first by getting a timestamp and then do a difference within a loop. The difference will give you the time elapsed in ms.
    You can also use the Get Date/Time String or Get Date / Time in seconds and once again take a snapshot when a first even occurs and another snapshot at the next even (at a point where you want to measure elasped time). This method is particularly useful if you want to timestamp an event.
    If I didn't answer your question, can you elaborate what you mean by "How can I count time".
    Best of luck..
    JLV

  • How can I create a method with throws  instruction

    Hello Everybody!
    How can I create this method inside WebDynpro.
    I enter "throws CloneNotSupportedException" manually an it removes always.
    What is wrong ?
    public java.lang.Object clone( ) throws CloneNotSupportedException{
        //@@begin clone()
         __Tdag__Is_Charactconfig that= (__Tdag__Is_Charactconfig)super.clone();
           return that;
        //@@end
    Regards
    sas

    I only checked in my 7.1 IDE and there this section exists.
    If it does not exist in your IDE, just create the method manually in the //@@begin others ... //@@end user-coding-area at the end of the controller class. This solves the issue for methods that are called from inside the controller. For public methods to be called from other controllers, this will not help.
    Armin

  • How can i access the methods if i only got the java class file?

    just like what the topic said...i would like to ask if i only got the class file of java without API documentation. how can i know what method is included ?
    thanks a lot.
    my email address is : [email protected]

    Class.getMethods()
    throws SecurityException
    Returns an array containing Method objects reflecting all the public member methods of the class or interface represented by this Class object, including those declared by the class or interface and and those inherited from superclasses and superinterfaces. The elements in the array returned are not sorted and are not in any particular order. This method returns an array of length 0 if this Class object represents a class or interface that has no public member methods, or if this Class object represents an array class, primitive type, or void.

  • How can i copy a dbx executable to other machine to run without installion

    How can i copy a dbx executable to other machine to run without installion whole workshop
    packet??? how to generate a configuration for dbx alone???
    thanks

    Hi, thanks for you help.
    actually, I have once copied dbx to other machine. certainlly, it needs a license. But when I copied
    a license file from the directory /opt/SUNWspro/license-dir/ of machine that installed Workshop
    to another machine that i want to run dbx. dbx starts correctly. but when i type
    $ dbx ipCentrex
    it prints following message:
    dbx: warning: cannot find global initialization file: dbxrc
    /opt/wacos/./.dbxrc[1]: syntax error
    dbx: installation problem, can't find help file: ./SUNW_SPRO_Dbx_help.info
    _find_executable: not found
    To suppress this message, add the following line to your .dbxrc file:
    dbxenv suppress_startup_message 6.2
    Reading ipCentrex
    dbx: warning: setuid program exec()ed. Reattaching
    There might be too many LWP's in this process.
    See `help dbxenv' under mt_scalable.
    dbx: Cannot open lwpstatus.
    dbx: warning: process initialization failed
    dbx: warning: can't find file "/opt/wacos/server/feature_server/bin/obj/ipCentre
    x/ipcentrex_main.o"
    dbx: warning: see `help finding-files'
    when it says that has errors in .dbxrc file, I can remove this file. But the critical error is why it says
    too mamy LWP's in this process? when I debug it at a machine that installed workshop, this error not occurs.
    anyone have answer?

  • How can i pass rowiterator method

    hi how can i pass rowiterator method
    i got below method how can i pass it to my postchanges mothod e.g
    SmsPropertiesImpl property = getSmsProperties();
    am in jdeveloper 11.1.2.1.0
    public class SmsPartyAddressImpl extends EntityImpl {
        public RowIterator getSmsProperties() {
            return (RowIterator)getAttributeInternal(SMSPROPERTIES);
        public void postChanges(TransactionEvent e) {
            /* If current entity is new or modified */
            if (getPostState() == STATUS_NEW ||
            getPostState() == STATUS_MODIFIED) {
            /* Get the associated property for the postaladdress */
           // SmsPropertiesImpl property = getSmsProperties();
            //SmsPropertiesImpl property  = getSmsProperties();
                SmsPropertiesImpl property = new SmsPropertiesImpl();
               // SmsPartyAddressImpl property = new SmsPartyAddressImpl();
            /* If there is an associated property */
            if (property != null) {
            /* And if its post-status is NEW */
            if (property.getPostState() == STATUS_NEW) {
            * Post the property first, before posting this
            * entity by calling super below
            property.postChanges(e);
            super.postChanges(e);
    }

    hi how can i pass rowiterator method
    i got below method how can i pass it to my postchanges mothod e.g
    SmsPropertiesImpl property = getSmsProperties();
    am in jdeveloper 11.1.2.1.0
    public class SmsPartyAddressImpl extends EntityImpl {
        public RowIterator getSmsProperties() {
            return (RowIterator)getAttributeInternal(SMSPROPERTIES);
        public void postChanges(TransactionEvent e) {
            /* If current entity is new or modified */
            if (getPostState() == STATUS_NEW ||
            getPostState() == STATUS_MODIFIED) {
            /* Get the associated property for the postaladdress */
           // SmsPropertiesImpl property = getSmsProperties();
            //SmsPropertiesImpl property  = getSmsProperties();
                SmsPropertiesImpl property = new SmsPropertiesImpl();
               // SmsPartyAddressImpl property = new SmsPartyAddressImpl();
            /* If there is an associated property */
            if (property != null) {
            /* And if its post-status is NEW */
            if (property.getPostState() == STATUS_NEW) {
            * Post the property first, before posting this
            * entity by calling super below
            property.postChanges(e);
            super.postChanges(e);
    }

  • How can I get Firefox to execute html code in a text file?

    I used Notepad to create a text file, markup.html, that contains html code. How can I get Firefox to execute this code?
    Also, how can I use the <script> tag in the html code using the src attribute to execute code in a file written in Javascript?

    First guess is that you did not use an .html extension on the file. The file may well be ''name.html.txt''
    * see http://www.bbc.co.uk/webwise/guides/file-extensions
    *http://windows.microsoft.com/en-gb/windows/show-hide-file-name-extensions#show-hide-file-name-extensions=windows-vista
    Forum Note
    This is normally offtopic for this forum. I say normally because now we cover webmaker questions. I wonder if this is therefore on topic as a webmaker question?
    I have tagged with webmaker-contribution

  • How can i edit payment method if i signed up for non payment

    How can i edit payment method if i signed up for non payment?

    Contact iTunes Customer Service and request assistance with your issue.
    Apple  Support  iTunes Store  Contact Us

  • How can I call a method for all instances of a certain class?

    Hi,
    I have created a snake java applet, which you can play here [http://users.telenet.be/javagames/|http://users.telenet.be/javagames/].
    But now I want to make this into a multi-player game (with two or more snakes etc..).
    In my main class you can find methods like these:
    snake.move();
    snake.drawSnake();Now if I just alter my main class and make a second instance of the class snake and change my methods to this,
    snake.move();
    snake2.move();
    snake.drawSnake();
    snake2.drawSnake();my game almost works perfectly, I'll have to make some minor changes though.
    But my question is, is there a better way of doing this. Instead of duplicating all the code, how can I make the methods immediately work for both snakes, instead of calling it twice?
    All suggestions are welcome!
    Thanks in advance.
    Lennart

    If there was something common to all snake instances then you could declare that variable static.
    Note: I don't want to confuse you here. A static variable can have a value apart from any instances at all. Instances can view static variables but a static method or inner class, for example, cannot view instance variables.
    More generally, I would think you would want to treat each snake as an automaton with its own behavior. There must be some class such as Game or Board or whatever that has, as suggested, either an array or collection of snakes. Iterate over each snake, ask it to perform some computation for the game and then draw itself.
    - Saish

  • How can I call a Method in a Transformation Routine

    Hello Experts,
    How can I call a Method in a Transformation Routine ??
    THNXX

    Hi,
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19?quicklink=index&overridelayout=true
    It will be help full .
    Regards,

  • How can we call the method of used controller?

    Hi All,
       i created two WDA Applications.( like YWDA1,YWDA2 ) . i am using the component WDA2 in WDA 1.and displaying the one view of WDA2 as popup window in WDA1 on action of one of the input element in the view of WDA1 by using the method l_window_manager->create_window_for_cmp_usage
    I have a button on the view of WDA2 which has appear in the popup window...how can i call the method which has binded to that button....and where should i code that...and i need to assign selected value in the popup window to input elemetn of view  WDA1
    Please help me to resolve this....
    Regards,
    Ravi

    You can not directly call view's event handler from other component.
    create a method in component controller of the second component and in the button click call the component controller method. ( also make the method as interface so that you can call it from other components )
    Now, you can call the interfacecontroller's method
    DATA: l_ref_INTERFACECONTROLLER TYPE REF TO ZIWCI__VSTX_REBATE_REQ_WD .
      l_ref_INTERFACECONTROLLER =   wd_This->wd_CpIfc_<comp usage name>( ).
      l_ref_INTERFACECONTROLLER->Save_Rr(
        STATUS = '01'                       " Zvstxrrstatus
    save_rr is the method of second component controller

  • How can I count events during a given time with 2 counters (6025 E)

    Hi, How can I count events during a given time (1 sec for example) with 2 counters:
    what is the best way?
    how should i configurate both counter?
    i have done the 1st counter in ev_counter with the gate being the output of the 2nd; and how can i say to the 2nd to trig the first after 1 sec counting? (trig at start and at end) what are the functoins calls in NIDAQ. i am using Visual C++

    Greetings,
    When you perform event counting a gate signal can be added such that if a low signal occurs on the gate, then the counter will pause. When a high signal is seen, the counter will continue counting edges. When you install the NI-DAQ driver you should have installed the examples for Visual C++. The counter examples are found in \Program Files\National Instruments\NI-DAQ\Examples\VisualC\Ctr. Take a look at STCeventCount.C. Be sure to only use STC examples with your hardware. The E-series boards contain the DAQ-STC chip.
    Now, all you need is a gate signal with a width (high time) of 1 second. You could use an external frequency or pulse generator to do this. Or, you could just use the second counter found on your PCI-6025E board. In this
    case you could configure the second counter to generate a single pulse. Take a look at the STCgenerateSinglePulse.C example. As long as the pulse is in a high state for one second you can use it to gate (or time) your counting of events.
    Regards,
    Justin Britten
    Applications Engineer
    National Instruments

Maybe you are looking for