How JSP run automatically

I would like to write a jsp file that can run in every 5 minutes.
My situation is that jsp file will include some sql statements which
will update a table in MS SQL Server according to some criteria.
The table need to be updated automatically to serve the business purposes.
So, i need a JSP file that can run automatically to serve this purpose.
Hope that some one can give some suggestion to me.
Thanks !

import java.util.Date;
import java.sql.*;
public class Test {
public static void main(String[] args) {
Connection conn = null;
String s1 = "";
PreparedStatement stmt = null;
ResultSet rset = null;
     while (true) {
     System.out.println("The time is "+new Date());
     try {
Thread.sleep(5*60*1000);
** place sqlserver to update table here
** example:
** java.util.Properties info = new java.util.Properties();
** info.put ("user", userid);
** info.put ("password", passwd);
** s1 = "jdbc:<database type>:thin:@" + host + ":" + port + ":" + database ;
** DriverManager.registerDriver ( new oracle.jdbc.driver.OracleDriver());
** conn = DriverManager.getConnection (s1,"scott","ctrl");
** s1 = "update table set column = ? where column = ?";
** stmt = conn.prepareStatement(s1);
** stmt.setString(1,var1);
** stmt.setString(2,vat2);
** rset = stmt.executeQuery();
** rset.close();
** stmt.close();
** conn.close();
} catch (Exception exc) {}

Similar Messages

  • How to run automatic payment program business area wise

    dear all
    please let me know how to run automtic payment program business area wise.
    for example business area 2020 we want to make payment business area wise.
    what are the back gorund settings for congigration Tc- fbzp
    wht are the configrations forTC- f110
    regards
    babu

    Hi,
    You can make payments business area wise if you had ticked payment goup business area wise in the payment method in company code screen. However you will have to give company codes in the payment parametets, but payments will be grouped by business area.
    Thanks,
    Ramesh.

  • How to run automatic plan data transfer to Profit Center Accounting?

    Can anybody help me telling how to transfer plan data automatically to Profit Center Accounting?
    At the moment I use 1ke0 to transfer manually.

    Hi,
    You can the option in Customizong "Define Versions"  > Settings for Fiscal Year > choose the Integrated Planning,
    but if already exists planned data, set the indicator by tcode KP96.
    Regards
    Elza

  • How to run f.13

    hi guru
       how to run  automatic clearing program(F.13), pls explan with configurations
    THANKS

    Hi,
    In order to run the F.13 you need to do setup the Clearing Rule in OB74, here you set up the criteria based on which system will clear the entry..
    For Example, Assignment Number, Business Area etc..
    Max 5 criteria you can choose.
    Hope this helps!!
    Br,Vivek

  • How to run JSP pages in weblogic 8.1 sp2

    hi frnzs,
    plese give me some idea about how to run JSP pages in weblogic server.

    enen i dont know hw to fly palne otherwise i can definitely give u sm guides abt that......

  • How to run JSP Report

    Hello,
    I am new at Reports 9i. I created report dummy.jsp which selects some data from a table.
    Could you please explain me how to run this JSP Report from internet explorer?
    Sincerely.
    givi

    Hello Givi,
    For running the JSP report from a browser, you need a J2EE container like OC4J. The JSP report can be run in two ways:
    1. rwservlet
    http://<we_server_host>:<port_no>/reports/rwservlet?<reports_parameters>
    2. the JSP deployed on the J2EE container
    http://<we_server_host>:<port_no>/<context_root>/your_report.jsp?<reports_parameters>
    Method 1 will actually display the paper layout of your report, while method 2 will display the web layout on the browser.
    If you want to start with basic information, pl refer to the section 8.1.2 of Publishing Reports document available at
    http://otn.oracle.com/docs/products/reports/content.html
    Navneet.

  • How to run the parameter form example report :pform_report.jsp

    how to run the parameter form example report : pform_report.jsp ?
    I got these error message:
    Reports Error Page
    Sat Oct 18 11:58:24 CST 2003
    javax.servlet.jsp.JspException: rwlib-1: REP-6106: (, 4 L, XML 1h��/�� ' PI with the name 'xml' can occur only in the beginning of the document.'.
    javax.servlet.jsp.JspException: rwlib-1: REP-6106: (, 4 L, XML 1h��/��
    PI with the name 'xml' can occur only in the beginning of the document.'.
         at oracle.reports.jsp.ObjectsTag.doEndTag(ObjectsTag.java:180)
         at examples.tools._pform__report._jspService(_pform__report.java:79)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:66)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:539)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:285)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:771)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:152)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:796)
         at java.lang.Thread.run(Thread.java:484)

    repost !
    please help!

  • How do I make the plugin run automatically when a photo is imported?

    I am trying to write a new plugin where the metadata will be automatically added to the photo when I import the photo in the Lightroom.
    How do I make the plugin run automatically when a photo is imported?
    Thanks for  your help!
    Regards,
    Prosenjit

    psaha84 wrote:
    What I want is, when I import a photo in Lightroom the plugin will run and assign the metadata.
    As John said, there is no mechanism to receive notification of import. The likely recourse is continuous polling (unless you get very creative..).
    You can try optimizing. e.g.: every second (or less), see if the count has changed, if it's gone up, something's been imported, if not then probably not (check anyway once in a while..).
    psaha84 wrote:
    How do I save the custom metadata with the image file?
    Lightroom 5 has the limitation, plugin  cannot link the custom metadata fields to XMP file or save them with image file.
    So, is there any alternative way to save the custom metadata?
    Yeah: Lightroom won't save custom metadata in xmp, nor read it if it's there, so you are pretty much on your own - you can save in a file, but if you save as non-standard sidecar Lr won't attend to it like it will jpg or xmp sidecar. For that reason it's often better to save in a separate dedicated location. You can save in image file itself, e.g. using exiftool if raw file, but that would make me nervous, and of course you'd have to have the logic to read it somewhere too..
    Good luck,
    Rob

  • How to run webi report automatically with the current date/system date in webi report

    Hi Friends,
    I have a webi report which has a date prompt now. Based on the selection that user makes while running a report, he will get the related data for that particular date selection. Now I want to make that date prompt automated that is the report should run automatically based on the system date daily on scheduling.
    I want it to run current day automatically without have to go in and pick the date in webi report. I will be scheduling the webi report. Can you please let me know how to achieve this functionality of running a webi report automatically with a system date.
    Please let me know if I couldn't make you understand so that I will write with an example.
    Waiting for your valuable solutions.
    Thanks in advance.
    Regards,
    Bhaskar

    Hello Bhasakar,
    1.Create sysdate object in the universe
    2.Create another query in webi and select only sysdate object
    3.In the original query drag the Day object in the filter pane and choose the "List of values" from another query.and select the sysdate object from the second query.
    So your report always will run for sysdate...
    regards,
    Naveen D

  • How to run jsp file in Apache Tomcat 5.0?

    hi,
    i'm using jdk1.5,jsp1.2 & Apache Tomcat 5.0 as a web server.in my application i have 2 jsp files,1 html file & 1 javabean class.where i must place the html,jsp files and the .java file & .class file for a bean class.how to run this application.
    bean class:
    public class Userdata {
    private String username;
    private String email;
    private int age;
    public void setUsername( String value )
    username = value;
    public void setEmail( String value )
    email = value;
    public void setAge( int value )
    age = value;
    public String getUsername() { return username; }
    public String getEmail() { return email; }
    public int getAge() { return age; }
    getname.html file:
    <HTML>
    <BODY>
    <FORM METHOD=POST ACTION="Savename.jsp">
    What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><BR>
    What's your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20><BR>
    What's your age? <INPUT TYPE=TEXT NAME=age SIZE=4>
    <P><INPUT TYPE=SUBMIT>
    </FORM>
    </BODY>
    </HTML>
    savename.jsp file:
    <jsp:useBean id="user" class="Userdata" scope="session"/>
    <jsp:setProperty name="user" property="*"/>
    <HTML>
    <BODY>
    Continue
    </BODY>
    </HTML>
    nextpage.jsp file:
    <jsp:useBean id="user" class="Userdata" scope="session"/>
    <HTML>
    <BODY>
    You entered<BR>
    Name: <%= user.getUsername() %><BR>
    Email: <%= user.getEmail() %><BR>
    Age: <%= user.getAge() %><BR>
    </BODY>
    </HTML>
    refer these source code and plz,give the result at the earliest.
    whether i want to write a web.xml file for this jsp file.
    if yes,means plz present the web.xml file for this application.
    plz,if anybody knows give me detailed description for this application.

    create a dir under webapps dir
    place your .html and .jsp files here
    also create WEB-INF dir here
    Under WEB-INF create classes and lib dir
    under classes dir put your .class file
    You also need to put web.xml under your WEB-INF dir.
    You ca keep your java file any where u want on your computer.

  • How to Run a Report automatically in Background for every night

    Hi,
    How to run a report program in Background automatically for every nigh.
    Thanks
    Ramesh

    Hi Ramesh,
    You can use SM36 and use the "Job Wizard" to define a background job in simple step by step procedure
    Or
    Goto SM37 and specify a job name.
    Next specify the ABAP Program Name of the report you want to execute under Job Step.
    Then click on "Extended Job Selection" and goto the Period Tab.
    There select "Only Periodic Jobs" and then specify the frequency of execution based on Months, Weeks, Days, Hours or Minutes.
    Hope this helps,
    Regards,
    Madhur
    Message was edited by: Madhur Chopra

  • How to use sinewave to controll my motor run automatically.

    Hello
    I am now tring to use a waveform(sinwave ) to control my motor run automatically .I am using  labview2010 and EPOS50/5. Is there anyone can give me your suggestion? Thanks in advance.The attachment is the program for my epos.
    Attachments:
    epos and sinewaveform.vi ‏34 KB

    PS: My program for epos can work, but I don not know how to combine the sinewave program with the epos program to make motor run automatically.
    Thanks your suggestion in advance.

  • How to run exception using JSP?

    How to run exception using JSP?

    Why would you need the <%%> between the if else blocks? Even if you attempt to write some data within the blocks in java, you will still get an error. For example, this is illegal:
    if(done)
        System.out.println(true);
    System.out.println("Hello World");
    else
        System.out.println(false);
    }The compiler is expecting the 'else' to be directly after the body of the if. If it encounters anything else, it will complain. So you cannot do this in jsp either, regardless if it's a different technology, it's the same compiler.

  • How to run servlet,jsp in eclipse software

    can any one tell me how to run servlet ,jsp in eclipse
    and how to start tomcat server in eclipse
    reply me
    regards
    saravana

    Can anybody help me as I wanted to know how to run servlet,jsp in eclipse software...
    If somebody can forward me the screenshots than it would be of great help....
    Thanks

  • How to run servlet,jsp in eclipseand to start tomcat in eclipse

    hi
    i want to know how to run servlet and jsp in eclipse 3.0
    and to start tomcat server in same.
    please reply me the steps involved indetail.
    regards
    saravanakumar

    Find Lomboz J2EE plugin and a tutorial of how to use it :)

Maybe you are looking for

  • How do I add multiple links?

    I know how to add a link to a button with the code snippets, but what I need to do now is add multiple choices, for example like a spry menu in html. I want something like: Beans - green            - lima            - pink            - fava with each

  • Loadjava fails; create java source succeeds

    When using loadjava to load a Java class into the database I receive the following error: C:\OEMNT\bin>loadjava -user us/pw@db -verbose -resolve HelloWorld.class initialization complete loading : HelloWorld Error while loading HelloWorld ORA-00942: t

  • How do I structure Information in three Levels in MDM 7.1?

    Hi, I am creating a Service Catalogue for a customer. They require three levels in the catalogue: "Packed Services" that are built up by several "Services", that can have several "Supporting Services". I am thinking  of using two main tables, and tup

  • How to display different screens when starting the Webdynpro app?

    Hi All, When user starting up the Webdynpro app, it will first check some value in the persistent layer. If the check result is ok, it will show the normal app screen to the user; if the check failed, it will show the error screen. Now I write the ch

  • SelectToolByName intermittently crashes (Illustrator CS6, OSX)

    Hi, I've been writing some tool switching code, and have been having an issue using Illustrator CS6 (16.0.4) on OSX (using either mountain lion or mavericks) where setting SetSelectedToolByName eventually crashes due to an EXC_BAD_ACCESS error, even