Scheduler implementation in Java

Hello All,
I need to implement the scheduler in Java, Here is my requirement
We need to run the particular events in scheduled intervals like weekly, monthly,Daily etc.we have the time stored in database, we need to compare the current time with the time stored in database and run the event.
I know that using threads we can run the events, but i heard that it is not efficient way, could any one helps me how to run the scheduler events in Java.
Iam working in Java (jdk 1.3), Linux, Apache
Thanks
Katta Srinivas

You can write a Servlet which has a daemon thread which checks the database every (day?) specified interval.
Thread servletThread = new Thread(this);
//check database
If no work
//Sleep for a day
If something scheduled
//Do the batch process
Don't forget to destroy the thread in the destroy() method of the servlet.

Similar Messages

  • How to create a  schedule program in java

    Hello Friends ,
    Can any one provide me with an example how to create a schedule program using java.util.timer etc . I am in need of a program which should run as a schedule job that searches for a file in a directory and read the latest files from that directory in every minute of time as a schedule job .
    Thanks
    mahesh

    I don't feel like writing my own example, but google will be happy to provide you with an example.

  • Design patterns implemented in java API

    Hi,
    I have some questions on design patterns implemented in core java class or in general in java API.
    1)Whether
    java.util.Collections, the checkedXXX(), synchronizedXXX() and unmodifiableXXX() methods.
    can be considered as a decorator pattern?
    2) Whether
    LinkedHashMap(LinkedHashSet<K>, List<V>) which returns an unmodifiable linked map which doesn't clone the items, but uses them
    can be considered as a Bridge pattern?
    3) Whether Facade pattern is implemented in java ? If so which API uses it?
    4) Whether
    •     All non-abstract methods of java.io.InputStream, java.io.OutputStream, java.io.Reader and java.io.Writer.
    •     All non-abstract methods of java.util.AbstractList, java.util.AbstractSet and java.util.AbstractMap
    can be considered as a Template method pattern?
    5) Whether
    •     java.util.Comparator#compare(), executed by among others Collections#sort()
    can be considered as a Stratergy pattern?
    6)
    Whether State pattern is implemented in java ? If so which API uses it?
    7)
    All implementations of java.lang.Runnable are considered as a Command pattern.
    8)
    Whether
    •     java.io.InputStreamReader(InputStream) (returns a Reader)
    •     java.io.OutputStreamWriter(OutputStream) (returns a Writer)
    can be considered as an Adapter pattern?
    Please clarify.
    Thanks.

    What do you think, and why?

  • How to implement a java application in Portal

    Hello,
    I was asked if it is possible to implement a java (not a web application / not java web dynpro) to implement into the portal. Is this possible with something like the java web start? Is someone using something like that in the real world?
    Thanks a lot,
      Vanessa

    Hi Vanessa.
    Yes, it is possible to integrate Java applets into portal. Have a look at XML Form Buider or SAP Management console (http://portalhost.domain:5xx13).
    Best regards,
    Aliaksandr Zhukau

  • How resource files(.rc) are implemented in java

    I want to know how resource files are implemented in java. I am using a window98 as OS.
    Thank you
    Abu_ramla

    I wonder if this might help:
    ResourceBundle rbd = ResourceBundle.getBundle("Filename");
    to get a property out of the resourceBundle use:
    String varname = (String) prb.getObject("propName");
    As allways, check the API
    Hope this helps
    Elouiza

  • Implementing a java connector

    Has anyone tried implementing a JCA Resource Manager the would integrate into a J2EE server for communication with a remote server?
    I'm thinking about implementing one for connectivity with an Http server....
    Has anyone tried something of this sort?

    mkx wrote:
    Hi,
    we are currently implementing a Java connector for the X11 windowing system and we're running into trouble with event handling.
    What we are doing is to fork a thread from the main application that will then invoke a native event handling loop that will listen for X11 events. Whenever such an event occurs, it will call back to a Java object to report that event.
    While receiving and reporting events works fine, any successive calls from the main thread to the native windowing functions will block the program.
    Let me outline the call order again:
    1. Java application is started, main thread created
    2. New Java thread is started that invokes a native method that itself runs in a while loop
    3. Normal program flow continues in the main Java thread
    4. Main Java thread now calls some native method, and locks up
    Any idea why this is happening? Is it not possible to invoke the same native code within two distinct Java threads? I have looked into the JNI functions AttachCurrentThread and DetachCurrentThread, but they only seem to handle the problem that two native threads share the same JVM, but that's not what we need. We have two Java threads that need to share the same native code.Are you sure its not a problem with the something in the X11 code being non-reentrant?
    http://www.gnu.org/software/libc/manual/html_node/Nonreentrancy.html#Nonreentrancy
    Jim S.

  • VCard implementation in Java

    Hi all,
    Has anybody implemented vCard in java....
    If yes, could you please explain how it can be implemented,
    thanks
    ybajaj

    There exists a publically available vCard implementation in Java. It is available under a BSD style license, and can be found at
    http://jpim.sourceforge.net
    It reads 2.1 and 3.0 cards (into a business object model) and is able to write 3.0 cards (from the business object model).
    Regards,
    Wimpi

  • ESB Implementation in Java to connect various services

    Hi,
    I am looking to use ESB to integrate various webservices running in differenr platforms like one in Java,PHP and .NET.
    I am using Oracle SOA Suite. Is there any examples in the internet how to do this? I am not able to find any? It will be really great if some can provide some light into this for the below points:-
    1) Setting up the ESB infrastructure
    2) ESB implementation in java
    3) To implement ESB we need to use only the JMS?
    Please do provide some helping hand which will help me to understand it and complete the process.
    Thanks in advance.

    I decompiled HttpClient and ConsoleClientImpl and this is what I found --- The following URL is what is constructed,
    http://localhost:80/esb/j_security_check and these parameters are passed as POST - j_username=oc4jadmin&j_password=welcome1
    I tried
    http://localhost:80/esb/j_security_check?j_username=oc4jadmin&j_password=welcome1
    and got 404 error.
    However, this exercise confirmed that hostname=localhost and port=80 is just fine.. the problem seems to lie somewhere else

  • Firewall implementation in java

    Need help about firewall implementation in java,Is it possible to develop application level firewall in java?how?

    No.
    You can control a firewall in C or such from Java. But you must have native codes in part of it.
    This question is asked repeatedly.. you really should have searched because the answer is always the same. You can't do it directly in Java.

  • Can be implemented with Java 2D?

    Could anyone tell me what kind of effect in this flash animation? it can be implemented with Java 2D?
    http://www.echt-wahnsinn.de/liebesgesichtflash.htm

    Thanks for your answer.
    so it's not only just for fun but the part of our semester project. :-)
    Could you explian it more in detail, I mean "manipulate the color/brightness values"
    please tell me if the step is right:
    1. load a new image as background pic and another new pic as the small image (using BufferedImage)
    because I will scale(maybe scale = 0.5) the both pics in my UI window.
    . img_org . img_min . img_result .
    2. create the background pic in third ImagePanel automatically and finish the image manipulations.
    at the same time to get the size of img_org, img_min, and color/brightness values, pixels.
    here I am not sure how to implement it effectively. image clipping?
    any suggestion and help are welcome!!
    laue

  • How to implement a java class

    dear friends
    i use forms6i server and oracle 9i server edition,under windows 2000 server
    i try to implement a java class for a bean area. i do the following :
    from the property palette i write the class name in implementaion class property . the class name is 'arc.class' and it is located in <oracle_home>/forms60/java
    but the fellowing error appears
    frm-13008 cannot find javabean with name 'arc.class'
    would any one help please

    Dear Grant Ronald
    thank you very much for helping me . now i undersatand how to implement a class. but i have another question ,and i wish you ccould help me .
    i try to import a java class, i do the following:
    From the program menue i choose Import Java Class
    but the following error appears
    (pde-uji001 faild to create JVM)
    by the way i use forms6i server and oracle 9i server under windows 2000 server
    thanks in advance
    tarek

  • Can I have my own implementation of java.awt.EventQueue

    Hi guys,
    Can I "override" the default implementation of java.awt.EventQueue? Some JVM/CVM tricks?
    For any tips, Thanks!

    I think what you're looking for is EventQueue#push(EventQueue).
    public static void main(String[] args) {
            final EventQueue queue = new EventQueue() {
                public void postEvent(final AWTEvent theEvent) {
                    super.postEvent(theEvent);
                    System.out.println("postEvent "+theEvent);
            Toolkit.getDefaultToolkit().getSystemEventQueue().push(queue);
            final JFrame frame = new JFrame();
            frame.setContentPane(new JButton("Click Me"));
            frame.setSize(300, 300);
            frame.setLocationRelativeTo(null);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
        }

  • Implement tegnologia Java Card

    Where I can be able to readers and cards to implement tegnologia Java Card

    Better download the Sun'sJavaCardKit freely availble online in Sun's website

  • How advantages of "Call By Reference" can be implemented using Java

    As I know that java doesnot support "Call By Reference" as C++
    does.
    I want to know that how advantages of Call by Reference can be
    implemented using Java.

    There is some misunderstanding here. Method arguments in Java are passed by value. However, if you pass a reference (to an object) by value, you can still modify the object that the (copy of the) reference points to.
    public void method1() {
      StringBuffer buf = new StringBuffer();
      // Here, method2 cannot change the value of the variable buf,
      // but it can modify the object that buf points to.
      method2(buf);
    public void method2(StringBuffer sb) {
      // You can modify the StringBuffer.
      sb.append("hello");
      // But this is useless, it will not change the variable buf
      // in the calling method.
      sb = new StringBuffer();
    }Jesper

  • Implementation of java bean

    hi
    every body...i am trying to implement a java bean, i have created the java class and it runs successfuly in jdeveloper envoirnment and after its deployment as jar file i implement it as bean in a bean area in my oracle form and it gives frm-92100
    error!!!!! any help???????
    zulfiqar

    thanks Degrelle for replying my post....
    but i could not get you.....as i have created a bean area on my canvas and it is visible as well and i have given my java class name in its implementation class property. what else it needs. i run that class from jdk and it runs successfully and even the other classes in the same jar file are being implented successfuly but this one is not... any further guidlines.......??
    best regards
    zulfiqar

Maybe you are looking for

  • Headphones doesn`t work

    my iphone 4 bought at apple store from Seattle 2 years ago and the headphones doesn`t work now can apple`s Genius fix that in the apple store where in Beijing? If the receiver has broken ,how much money will it takes?

  • Skip performing Sync Event (1) conversation id (null)

    <b>trying to modify a values and the row is deleted and new row inserted with the old values with different syncKey </b> [20070828 04:04:57:421] D [MI/Sync                  ] Initial buffer size of BinaryReader is 2628 [20070828 04:04:57:421] P [MI/S

  • Save document in Reader.  Can this happen?

    I have a document I created in LifeCycle Designer that I am filling-out in Reader.  Can I ever save this form that's filled-in? M

  • Intercompany Error

    Hell Guys, I got the error as "Requirements are not fulfilled for condition PI01" in the sles document & tab Condition. How solve? Thanks

  • Condition info of a Quotation

    Hello,    Is there any one can tell me the corresponding tables for Header conditions and item conditions in a Quotation? Thanks, Jeffrey