Java/jsp programing using timer

what I want to do is say
at 8am every day
send email news letter to all members on the database.
without the press of a button on my side.
anyone done such programing with java?
Sample codes will bve much appreciated.
Thanks in advance

This sounds a good idea nut that means the hosting co
have to allow the OS job to trigger it az 8 pm on
their system because something has to be on
permanently for it to happen.Well, that is information you might have given right away. In that case, you might be short of luck for a reliable way to do it. At least I can't think of a way - if all you can do is call a servlet, you'll need to activate it on 8 am yourself daily. I don't think you can make the servlet run in an endless loop that keeps it "alive" for eternity, to repeatedly trigger the mailing. I mean you probably can, but my bet is that it gets killed by the container after a certain timeout.

Similar Messages

  • How to execute a .exe file in java(Jsp) without using a process ???

    Hi All ,
    How to execute a .exe file in Jsp without using a process ??? ...
    Is it Possiable ????

    itsdhanasaraa wrote:
    But as this a web application ... By using Runtime i'm getting some probs ..
    Let me guess, you want your web application to run a program on the client and to your surprise that's not working?
    Ain't gonna happen.
    its taking more time to execute .... that's y is there any other option to execute .exe file other than Runtime.getRuntime().exec("filename");Write proper English and you may be taken more seriously.
    1) it's not "taking more time to execute", whatever that's supposed to mean.
    2) there's no other way to execute something. Not that you should every use even that way anyway
    3) whenever you start thinking of executing external programs from Java, start thinking of not using Java in the first place.

  • Help needed in executing the java/jsp program from UCM .

    Hi ,
    I have a .jsp program running in my Jdeveloper which when executed pops a window to browse and select files and with few custom options .
    But i want to execute that Program from within UCM (create a new jsp page in UCM OR provide link ? i am not sure .... ) , could anyone help on how i can execute/run the program from UCM ?
    thanks in Advance
    Plaxman

    If your jsp makes use of jars you may want to look into using a WAR instead. You can check the WAR into content server and there is even a link on the administration page for JSP Web App Admin. Treating the JSP(s) and jar(s) as an entity may be a more successful path for you.
    You can find some jsp examples and ever a war example in this directory: <install root>\samples\JspServer
    And the briefest of help about that stuff here: [http://localhost/idc/help/wwhelp/wwhimpl/js/html/wwhelp.htm|http://localhost/idc/help/wwhelp/wwhimpl/js/html/wwhelp.htm]

  • New in Java: java applet program using multithreading

    I am trying to write a program, which should move the words "Java Platform2" from left to right every time we 'refresh'.
    Can you please advise what is wrong in the logic??
    import java.applet.*;
    import java.awt.*;
    import java.lang.*;
    public class Ch61appth extends Applet implements Runnable
    int i=30;
    int x=10;
    int y=30;
    Thread t,cur;
         public void start()
              t=new Thread(this);
              t.start();
         public void paint(Graphics g)
              g.setColor(Color.blue);
              g.drawString("Java Platform2",x+i,y);
         public void run()
                   if ((x+i)<400)
                        {     i=i+20;
                        else
                        {     i=20;
              //cur=new Thread.currentThread();
              repaint();

    thanks for reply
    i tried using for loop. Earlier also i had tried using while loop with condition t==Thread.currentThread()
    The problem i am facing is the string just does not move and even after clicking refresh, it appears at same locations.
    CAN U ADVISE>
    bye
    kumar

  • AccessDenied Error deploying Java JSP app using Eclipse to Azure

    Hi,
    Following the the tutorial for deploying java servlet app on Azure using Eclipse on windows.
    Getting AccessDenied error while trying to upload, sample works locally.
    Thanks
    Raj

    Hi Raj,
    Which tutorial do you follow? Please have a look at below article, it gives details steps about how to deploy application to azure use Eclipse, please try again step by step, hope this helps.
    #http://msdn.microsoft.com/en-us/library/azure/hh690944.aspx
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Creating variables in a java swing program useing event

    This is my code:
    *Old School Calculator
    *@Collin Doering
    *Version 2.00
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class OSC {
         private static void createAndShowGUI() {
              int first = 0;
              int second = 0;
              int third = 0;
              int fourth = 0;
              int fifth = 0;
              int answer;
              System.out.println ("Calculations");
              System.out.println ("-------------");
              JFrame.setDefaultLookAndFeelDecorated(true);
              JFrame frame = new JFrame("OSC");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JButton button1 = new JButton("1");
    button1.setMnemonic(1);
    button1.addActionListener
         new ActionListener() {
              public void actionPerformed (ActionEvent e) {
    first = 1;
    //This is when the error says "Local variable first is accesed from
    with in inner class; needs to be declared final;
                   System.out.println ("first = ");
    JButton button2 = new JButton("2");
    button2.setMnemonic(2);
    button2.addActionListener
         new ActionListener() {
              public void actionPerformed (ActionEvent e) {
                   System.out.println ("Second = ");
    JButton buttonx = new JButton("x");
    buttonx.addActionListener
         new ActionListener() {
              public void actionPerformed (ActionEvent e) {
                   System.out.println ("answer: ");
    JPanel panel = new JPanel(new GridLayout(10,10));
    panel.add(button1);
              panel.add(button2);
              panel.add(buttonx);
              frame.getContentPane().add(panel);
    panel.setBorder(BorderFactory.createEmptyBorder(
    30, //top
    30, //left
    10, //bottom
    30) //right
    frame.pack();
    frame.setVisible(true);
         public static void main(String[] args) {
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    I am trying to create variables so i can make a calculator (right now i only have buttons 1, 1 and multiply). //This is when the error says "Local variable first is accesed from
    with in inner class; needs to be declared final; then when i declare it final it says <identifier expected>. Could some one please help me. thanx.

    Please post code within code tags (press the "code" button).
    Why are you using an inner class? Simplify:
    public class OSC implements ActionListener {
    button1.addActionListener( this );
    public void actionPerformed( ActionEvent e ) {
        if ( e.getSource() == button1 ) . . .

  • Java Network Programming using UDP protocol

    I am trying to send the object using UDP protocol.
    In my client class it is giving me NullPointer excetion at clientSocket.send(sendPacket); although sendPacket is not null it has the value that I am passing.
    Here is the code :
    private boolean clientSrvrComm(AuditorData audData) throws Exception
              boolean result = false;
              ByteArrayOutputStream barray_out = new ByteArrayOutputStream();
              ObjectOutputStream obj_out = new ObjectOutputStream(barray_out);
              obj_out.flush();
              obj_out.writeObject(audData);
              obj_out.flush();
              // sending the data to the server
              byte[] sendData = barray_out.toByteArray();
              DatagramPacket sendPacket = new DatagramPacket(sendData,sendData.length,IPAddress,serverPort);
              clientSocket.send(sendPacket); // getting exception at this line
              return result;
         } // method end
    I am passing audData through main method.
    Any help would be appreciate.
    Thanks,
    Swati

    actually it shouldn't give the null pointer exception and send the object to the server.
    I am not able to get, why it is throwing the exception, even there is no class for debugging.

  • Can anyone clarify my doubt in a simple JSP Program ?

    when we write a simple jsp program such as helloworld.jsp does a
    class file or servlet be created when we run the jsp program using a
    web browser and Tomcat ? if so please tell the folder(path) in tomcat
    where this class file will be located or stored .Thankq

    JSPs will (usually) be compiled into class files representing Servlets, yes. But that's something that happens internally inside the application server and shouldn't concern you.
    Why would you need to know where it resides? It seems like a code smell if you need that information.
    If you're just curious, then look into the work directory of your tomcat.

  • How to send mail using jsp program

    am very new to jsp and doing my final year project. i need to send mails using my jsp program.can anyone say wht to do that is wht to include to send mails using jsp program. n also a sample code to send mail using jsp program.
    Thanx in advance

    Use below script.
    <%@ page import="java.util.*, javax.mail.*, javax.mail.internet.*" %>
    <%
    Properties props = new Properties();
    props.put("mail.smtp.host", "mailserver.com");
    Session s = Session.getInstance(props,null);
    InternetAddress from = new InternetAddress("[email protected]");
    InternetAddress to = new InternetAddress([email protected]");
    MimeMessage message = new MimeMessage(s);
    message.setFrom(from);
    message.addRecipient(Message.RecipientType.TO, to);
    message.setSubject("Your subject");
    message.setText("Your text");
    Transport.send(message);
    %>{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Unable to connect to ECC system through stand alone JAVA program using JCO.

    Hi All,
    I want to connect to ECC system through standalone JAVA program using jco.while executing my java program it is saying that connection refused.
    I am getting the error as shown below.
    com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: CMALLC : rc=20 > Co
    nnect from SAP gateway to RFC server failed
    Connect_PM  GWHOST=192.168.10.99, GWSERV=sapgw01, SYSNR=01
    LOCATION    SAP-Gateway on host igm501 / sapgw01
    ERROR       partner '192.168.10.99:sapgw01' not reached
    TIME        Mon Sep  1 15:00:37 2008
    RELEASE     700
    COMPONENT   NI (network interface)
    VERSION     38
    RC          -10
    MODULE      nixxi.cpp
    LINE        2821
    DETAIL      NiPConnect2
    SYSTEM CALL connect
    ERRNO       239
    ERRNO TEXT  Connection refused
    COUNTER     2
            at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
            at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:11
    25)
            at com.sap.mw.jco.JCO$Client.connect(JCO.java:3138)
            at JConnector_frmDesk.<init>(JConnector_frmDesk.java:91)
            at JConnector_frmDesk.main(JConnector_frmDesk.java:141)
    I have already configured SAPDP01,SAPGW01 in my services file in windows\system32\drivers\etc\services.
    What else i need to do to connect to ECC system through my JAVA program.Please help me in this regard.
    Regards,
    Ramana.

    Hi !
    Check this to verify that you are correctly using JCO:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8e7daa90-0201-0010-9499-cd347ffbbf72
    Try to give in ashost="/H/saprouter/H/sap".
    Regards,
    Matias.

  • How to use 2 webcam for java at the same time?

    hi there,
    I have a question to ask regarding webcam and java. Basically i want to know whether is it possible to have 2 web cam running in java at the same time? I have no problem when running one usb webcam since i m using "
    ml = new MediaLocator("vfw://0") ;
    what parameter must i use to specify when using 2 web cam
    many thanks
    sun

    Hi
    I am making a project in which i have to capture a image through webcam. How can I do it will you please guide me or if can provide me code. Many thanks for your support. My email id is [email protected]

  • I uses Time Machine to transfer files and program from old to new MacBook Pro. Aperture doesn't work. Every time I open Aperture the computer need me to key in Serial number. How do I fix it.

    Hi There,
    I purchased a new MacBook Pro Retina 15". Since I am using MacBook Pro and I uses Time Machine for backup files and program. Store saleman tell me I can retore my existing program and files from old MacBook Pro to new MacBook Pro computer. After files transfer it seem to be OK. But only Aperture has a problem when every time I open Aperture to edit photos, MacBook Pro ask me to key in the Aperture Serial Number that made me so inconvinent. Did any one have meet this problem and can someone teach me how to fix it, Thanks.
    Nelson

    Either the license files were not transferred or it has to be relicensed.
    Remove and then re-install aperture. On an rMBP this should take only a couple of minutes.

  • How to set proxy authentication using java properties at run time

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

  • Setting profile option values using Java Concurrent Program

    Hi,
    I have a java concurrent program in which i am trying to update a profile option which is enabled only at site level, but the values are not getting committed once the CP completes.
    1. I am using CpContext.getProfileStore().SetProfile(<name>,<value>) to set the value.
    2. I am printing CpContext.getProfileStore().getProfile(<name>) in the same run and this works.
    3. BUt once the CP completes, the values are gone. Seems we have to issue a commit.
    3. So i used CpContext.getJDBCConnection().commit; Even this doesn't commit.
    Pls. suggest. Has anyone used these APIs to update profile options?
    Thanks,
    Suresh.

    I am not not a java expert, but pl see if MOS Docs 305710.1 (A SAMPLE JAVA CONCURRENT PROGRAM) and 827563.1 (How To Create a Java Concurrent Program?) can help
    HTH
    Srini

  • Display pop ups in the jsp by using Java script

    Hi
    can any body say ,how to display pop ups in the jsp by using Java script ?

    that's correct. You can use the below code for AJAX request.
    <script type="text/javascript">
    var httpObject = getHTTPObject();
    //create XMLHttpRequest object
    function getHTTPObject() {     
         var xmlhttp;
         if (window.XMLHttpRequest) // if Mozilla, Safari etc
              xmlhttp = new XMLHttpRequest();
         else if (window.ActiveXObject){ // if IE
              try {
                   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
              catch ( e ){
                   try{
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                   catch ( e ){}
         return xmlhttp;
    //define the function to send the request
    function sendRequest(){
        var currDesc = document.getElementById("description").value;
        var URL =  "manageMaintAction.do"; //action mapping in your struts-config
        var queryString = "currDesc="+escape(currDesc); //get the currDesc value in your action class like request.getParameter("currDesc")
        httpObject.open( "Post", URL, true );
        httpObject.onreadystatechange = cbFn;
        httpObject.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded");
        httpObject.send(queryString);
    //callback fn
    function cbFn() {
        if (httpObject.readyState == 4)
             if (httpObject.status == 200)
              var result = httpObject.responseText;
              alert(result);
    </script>

Maybe you are looking for

  • Scanner software problem.

    HP wireless all-in-one CN245B Hi to everyone. I just bought this printer and I've got a problem with the scanner software. Can I scan all the document I want and after save them all together? From the sofware it seems that's possible, but when I do a

  • Video in Menu

    I've been trying to incorporate a video in my menu, but despite many tutorials I'm still struggling. Below is my created menu. I've created it so that I can play a video within the large white area that takes up the bottom left corner of the menu. I

  • Single Project Won't Load - Eternal Beach Ball - File too large?

    I had just finished putting in the last still image in a project in iMovie last night when all of a sudden, my whole computer crashed. Another friend had been working on the same project on my machine and had mentioned that occasionally iMovie would

  • Auto PO by Fax/ Mail

    Hi All, We have a requirement to Fax/Email the Purchase order to vendors upon creation. The requirement is such that suppose there are 4 vendors A,B, C and D For vendor A we have a Fax no and email id maintained in the vendor Master For vendor B we h

  • Next Steps?  - Flash Player Tests Good, Won't Play

    Install went smoothly.  The Flash Player troubleshooting page shows latest version installed on both Safari and FireFox.  The Flash test animation works fine.  I've been through the "enable Flash Player" steps for both browsers.  But when I try to ru