can you give me any hint for writing a background java program?

Discussion in 'Java' started by Garg, Nov 11, 2006.

  1. Garg

    Garg Guest

    Hi All,

    I a write a process in java which will run in the background.

    Can you give me any hint for this or any sample code.

    thanks in advance,
    Tarun Garg
     
    Garg, Nov 11, 2006
    #1
    1. Advertising

  2. Garg

    Karl Uppiano Guest

    "Garg" <> wrote in message
    news:...
    > Hi All,
    >
    > I a write a process in java which will run in the background.
    >
    > Can you give me any hint for this or any sample code.
    >
    > thanks in advance,
    > Tarun Garg


    Do you mean a service or daemon without a console or UI? Or just a thread
    that does some processing in the background of a Java application?
     
    Karl Uppiano, Nov 11, 2006
    #2
    1. Advertising

  3. Garg

    Garg Guest

    Thanks for Reply,

    Basically requirement is to write a process which runs 24*7 and monitor
    some conditions in the database and it has to send out a mail if that
    condition is fullfilled.
    so please suggest me what will be the best way.

    Thanks in advance,
    Tarun Garg

    On Nov 11, 11:20 am, "Karl Uppiano" <> wrote:
    > "Garg" <> wrote in messagenews:...
    >
    > > Hi All,

    >
    > > I a write a process in java which will run in the background.

    >
    > > Can you give me any hint for this or any sample code.

    >
    > > thanks in advance,
    > > Tarun GargDo you mean a service or daemon without a console or UI? Or just a thread

    > that does some processing in the background of a Java application?
     
    Garg, Nov 11, 2006
    #3
  4. Garg

    Karl Uppiano Guest

    "Garg" <> wrote in message
    news:...
    > Thanks for Reply,
    >
    > Basically requirement is to write a process which runs 24*7 and monitor
    > some conditions in the database and it has to send out a mail if that
    > condition is fullfilled.
    > so please suggest me what will be the best way.
    >
    > Thanks in advance,
    > Tarun Garg
    >


    Thanks for clarifying. Without getting into specifics, you just need to
    write a console Java application to do this. That is, no Swing, no AWT, just
    a program that starts with void main(String[] args). You just code it to run
    forever. If you need to check something periodically, you might consider
    using java.util.Timer. You will need to use JDBC or other database access
    library to monitor the database. You will probably need to use the JavaMail
    API to send mail. Refer to the Java API documentation for details. It is all
    I usually need.

    If you need your application to start automatically, and run as a service in
    Windows, you will need to use one of the many Java service runners that let
    you run Java as a service. Google "Java Windows Service". Alternatively, you
    can run your application as a daemon with a simple shell script. Google
    "Java Unix daemon".

    This project uses a number of Java technologies. You might have to download
    JavaMail from java.sun.com and possibly JDBC drivers from third party
    vendors. Using Google, I think I rounded up everything a person would need
    for this in less than 15 minutes. Google is your friend.
     
    Karl Uppiano, Nov 11, 2006
    #4
  5. Garg

    Garg Guest

    Hi karl,

    thanks for the suggestion,

    I think for writing a thread will be a good option.

    or do you suggest me any thing else.

    Thanks
    Tarun Garg

    Karl Uppiano wrote:
    > "Garg" <> wrote in message
    > news:...
    > > Thanks for Reply,
    > >
    > > Basically requirement is to write a process which runs 24*7 and monitor
    > > some conditions in the database and it has to send out a mail if that
    > > condition is fullfilled.
    > > so please suggest me what will be the best way.
    > >
    > > Thanks in advance,
    > > Tarun Garg
    > >

    >
    > Thanks for clarifying. Without getting into specifics, you just need to
    > write a console Java application to do this. That is, no Swing, no AWT, just
    > a program that starts with void main(String[] args). You just code it to run
    > forever. If you need to check something periodically, you might consider
    > using java.util.Timer. You will need to use JDBC or other database access
    > library to monitor the database. You will probably need to use the JavaMail
    > API to send mail. Refer to the Java API documentation for details. It is all
    > I usually need.
    >
    > If you need your application to start automatically, and run as a service in
    > Windows, you will need to use one of the many Java service runners that let
    > you run Java as a service. Google "Java Windows Service". Alternatively, you
    > can run your application as a daemon with a simple shell script. Google
    > "Java Unix daemon".
    >
    > This project uses a number of Java technologies. You might have to download
    > JavaMail from java.sun.com and possibly JDBC drivers from third party
    > vendors. Using Google, I think I rounded up everything a person would need
    > for this in less than 15 minutes. Google is your friend.
     
    Garg, Nov 13, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Pope
    Replies:
    5
    Views:
    488
    Silvio Bierman
    Feb 22, 2004
  2. Porky Pig Jr
    Replies:
    3
    Views:
    404
    Dave Cole
    Aug 24, 2004
  3. Robert Brewer
    Replies:
    4
    Views:
    406
    Porky Pig Jr
    Aug 24, 2004
  4. chuan

    Please give me a hint!

    chuan, Apr 23, 2009, in forum: C++
    Replies:
    4
    Views:
    440
    Victor Freire
    Apr 24, 2009
  5. Pawel_Iks
    Replies:
    3
    Views:
    129
    Pawel_Iks
    Apr 9, 2008
Loading...

Share This Page