How can I create a scheduled java application/task?
Hi,
Being a complete newbie to the Java language, I hope I am forgiven if the above is blindingly obvious.
I have a java application which I have developed that when run from the command prompt (java xyz) selects a bunch of records from my database, then creates a text file with the results. Pretty simple stuff.
My question is, how can I automate this process? I would like it to run every night at midnight. Will I have to create a batch file? If so, how? Help!!
Any advice would be much appreciated :)
Thanks, Chris
Scheduling a task is a very Operating System dependent operation. It does not exist in some OS's without some kind of addin. Things of this sort are usually not done exclusively in Java, unless you want to have your application running all the time and simply perform some operation at a specific time (see Timer). Otherwise look on google.com for 'scheduler' and 'windows 98' for example.
Similar Messages
-
How can i create messenger with java tv API on STB
deal all.
how can i create messenger with java tv API on STB.
how can Xlets communicate each other?
how?
i am interested in xlet communications with java tv.
is it impossible or not?
help all..You can create a messenger-style application using JavaTV fairly easily. JavaTV supports standard java.net, and so any IP-based connection is pretty easy to do. The hard part of the application will be text input, but people have been using cellphone keypads to send SMS messages for long enough that they're familiar with doing this. This doesn't work well for long messages, where you really need a decent keyboard, but for short SMS-type messages it's acceptable.
The biggest problem that you need to work around is the return channel. Many receivers only have a dial-up connection, ties up the phone line and potentially costs people money if they don't get free local calls. Always-on return channels (e.g. ADSL or cable modem) are still pretty uncommon, so it's something that you nee to think about. Of course, if you do have an always-on connection then this problem just goes away.
This is really one of those cases that's technically do-able, but the infrastructure may not be there to give users a good experience.
Steve. -
Can we Create Setup of java Applications ?
Like VBasic can we create the setup of java Application containing main function. How to do this ?
It's possible the OP is asking about installers. The
last time I seriously used VB (in the 1990s) it came
with a cheapo installer so you didn't have to pay
money for InstallShield.Then perhaps the OP might wish to try something like this?
http://www.google.com/search?q=free+java+installer -
How can I create an Install.exe(Application file)
I need urgent help on how to create an Install.exe (Application file) for my java programs.
I have compile the java file and run the programs within Jbuilder35 all worked well. I even created a single jar file for all the programs classes file. But my problem was how to create Install.exe (Application file) in other to be able to use it as an application in any computer.
I mean, for example: Jbuilder35 was developed with java file, and I installed (JBuilder Install.exe, application file) in my computer before I could be able to use it. That is exactly what I dont know how to do it with my java programs that I developed. Any help please?.Use InstallAnywhere. They have a free trial addition.
http://www.zerog.com/downloads_01.html -
How can I create a schedule in Java for sending mail from SAP?
Hello;
I am coding a programme in Java which reads data from KM. I wish to schedule a job which sends mail to a list of persons selected from KM. I read the article by Prakash Singh and based my programme on his explanations.
/people/prakash.singh4/blog/2005/04/20/did-you-know-you-can-schedule-jobs-in-portal-using-kms-scheduler-task
My first problem is that I don't know how to send mail in SAP, and how to use Java to send this mail. My second problem is how to develop this "schedule job" function - is it enough to use Prakash Singh's method, or does it need to be changed?
Can anyone help me with these questions?
Thank you very much, R.E.Hi,
I dont know about the CATS system. But when ur user selects the varaint, he should remove his own id and execute the query. This should display all the variants existing for that program. Then he can select the required variant.
The user can also save this varaint under his own ID
Hope it helps.
Regards.
Jay Gandhi -
How can i create datasource on apache server for ADF application?
Hi All,
i my use case i have created simple adf application using ADF BC and want to deploy on Apache server 6.x.
So my question is that how can i create Data Source i have goggling and find two different way to do this.
1. write following line of code on apache server conf/Context.xml file.
<Resource name="jdbc/TestDB" auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@localhost:dst"
username="jagrandb" password="jagrantest" maxActive="20" maxIdle="10"
maxWait="-1"/>
but when i have used this way i got following exception.
org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection
check link-
https://forums.oracle.com/thread/2564233
2. write following line of code apache conf/Server.xml file
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
<Resource name="jdbc/TestDB" auth="Container"
type="oracle.jdbc.pool.OracleDataSource"
description="User database that can be updated and saved"
driverClassName="oracle.jdbc.driver.OracleDriver"
factory="oracle.jdbc.pool.OracleDataSourceFactory"
url="jdbc:oracle:thin:@//172.31.43.207:1521:dst"
username="jagrandb" password="jagrantest" maxActive="20" maxIdle="10"
maxWait="-1" />
</GlobalNamingResources>
and add this line in context.xml file inside <context> tag
<ResourceLink global="jdbc/TestDB" name="jdbc/TestDB" type="oracle.jdbc.pool.OracleDataSource"/>
but when i have run application i have got following error
log-
javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: invalid arguments in call"
at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:298)
at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:181)
at org.apache.jsp.test_jsp._jspx_meth_sql_005fquery_005f0(test_jsp.java:110)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:63)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
at java.lang.Thread.run(Thread.java:662)
Aug 2, 2013 5:17:21 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: invalid arguments in call"
at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:298)
at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:181)
at org.apache.jsp.test_jsp._jspx_meth_sql_005fquery_005f0(test_jsp.java:110)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:63)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
at java.lang.Thread.run(Thread.java:662)
so what is the solution how to create datasource on apche server which suitable for adf application?
when i test data source using following code used 1. way as i mentioned above its running fine bt not for second.
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<sql:query var="rs" dataSource="jdbc/TestDB">
select empname from pay_emphdr where empcd='JK1306'
</sql:query>
<html>
<head>
<title>DB Test</title>
</head>
<body>
<h2>Results</h2>
<c:forEach var="row" items="${rs.rows}">
Foo ${row.empname}<br/>
</c:forEach>
</body>
</html>
please help me. it is very urgent.
thanks in Advance
ManishHi Lindalnci
i have already tried this tutorial and in my post i have defined first way to do using this procedure.
in that case i have got following exception as i have mentioned above
org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection -
How can I create a java.awt.Image from ...
Hi all,
How can I create a java.awt.Image from a drawing on a JPanel?
Thanks.JPanel p;
BufferedImage image =
new BufferedImage(p.getWidth(), p.getHeight, BufferedImage.TYPE_INT_RGB);
Graphics2D g = image.createGraphics();
p.paint(g);
g.dispose(); -
How can I know the version of Application Server Java Virtual Machine
How can I know the version of Application Server Java Virtual Machine?
Thanks a lot.Thats easy. Your jdk/jre are located in the App Server home directory. Just run the java command under the jdk directory with the "-version" switch and it will provide you with detailed information about your VM.
For example if you're doing it at command prompt it will be something like
java -versionI hope this will be useful to you.
Regards,
Wasif -
How can I create a Java help file (*.hs)?
How can I create a Java help file (*.hs)?
Thanks a lot.
I know it is rather poorly used, but I still need it for our current software
Mit freundlichen Grüßen / With best regards
Hans-Jürgen Hengsbach - Produktmanagement / Product Management (-227)
Von: Peter Grainge [email protected]
Gesendet: Dienstag, 29. April 2014 16:48
An: Hengsbach.Hans-Juergen
Betreff: How can I create a Java help file (*.hs)?
Re: How can I create a Java help file (*.hs)?
created by Peter Grainge <http://forums.adobe.com/people/Peter+Grainge> in RoboHelp - View the full discussion <http://forums.adobe.com/message/6340535#6340535 -
How can I create JScrollPane in my swing application with scroll bars movin
Hi,
How can we create scrollpanes moving with scrollbars.I tried many times with custom layout.but it does not work if i set custom layout.I hope that I will get my problem solved.
Thanks and Regards,
Rameh RKThis means it is not possible to create a pure unicode file without the byte order mark?
You wouldn't happen to know how a file with byte order mark should read on a Linux system?
Or if this possible or not?
Regards
Christian -
How can I create Windows Explorer (as a Tree strucuture) in Java
Hi All,
How can I create a Windows explorer (as a tree structure) in a Frame window?
Thanks
SumodeFile[] roots = File.listRoots();
for (File root : roots) {
System.out.println(root.toString());
File[] directoryContent = root.listFiles();
if (directoryContent != null) {
for (File directoryFile : directoryContent) {
System.out.println("File: " + directoryFile.toString());
} -
Is there any spinControl in Java? If not how can i create it. Thanks in adv
I need a controller which will increment and decrement the integer value in the textField. Just like the spin control of printdialogbox of word or netscape. How can I create it?
There is JSpinner in JDK 1.4.
If you are using an earlier version, you will need to create your own.
All you need is a JTextField and two buttons. Attach actionListeners to the buttons, and depending on which button is selected, change the JTextField value.
Hope that helps. -
How can I create an element in the model node?
Hi, Experts,
I create a model node that name is containerNode in the contxt. Cadinility is: 1..n
I write the code in the method:
private String getDataForOutputTable( IWDNode wageTypePayslip, IWDNode containerNode ){
String betrgSumStr = "";
int index = 0;
Vector containerVector = new Vector();
int size = wageTypePayslip.size();
IWDNodeElement element = containerNode.createElement();// The system report error when I run the application.
BigDecimal betrgSum = new BigDecimal( 0 );
I try to create a element in the containerNode, But the system report error when I run the application.
java.lang.IllegalArgumentException: model object must not be null
at com.sap.tc.webdynpro.progmodel.context.ModelNodeElement.<init>(ModelNodeElement.java:66)
at besuretech.com.wdp.IPrivatePayDataDispView$IOContainerElement.<init>(IPrivatePayDataDispView.java:1537)
at besuretech.com.wdp.IPrivatePayDataDispView$IContextNode.doCreateElement(IPrivatePayDataDispView.java:88)
at com.sap.tc.webdynpro.progmodel.context.NodeInfo.createElement(NodeInfo.java:884)
at com.sap.tc.webdynpro.progmodel.context.Node.createElementInternal(Node.java:1351)
at com.sap.tc.webdynpro.progmodel.context.Node.createElement(Node.java:1370)
at besuretech.com.PayDataDispView.getDataForOutputTable(PayDataDispView.java:251)
at besuretech.com.PayDataDispView.getAllData(PayDataDispView.java:196)
at besuretech.com.PayDataDispView.onPlugPayListViewIn(PayDataDispView.java:154)
at besuretech.com.wdp.InternalPayDataDispView.wdInvokeEventHandler(InternalPayDataDispView.java:391)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.navigate(ClientApplication.java:826)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.navigate(ClientComponent.java:881)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doNavigation(WindowPhaseModel.java:498)
How can I create an element in the model node ?
Best regards,
taoHi,
You need to execute the model before creating the element.
Regards
Ayyapparaj -
How can I create a simple chat function in a mobile app for iOS and Android
I am wondering how can I create a chat function in my mobile app creating in AIR and Flex. The chat should be similar to the one in WhatsApp.
Do you know some possible solutions?
Thank you in advance!To enable chat messages, you need a server. The kind of server depends on the application. Do you want to create a chat like application like WhatsApp, where the server pushes messages without an active connection? Or do you have some sort of online game, where chat messages can only be transferred when the client is connected already?
I have an online game where clients are connected to a Java server at all time. From there it is pretty straight forward:
2 textfields:
- 1 line textfield for input messages
- multi-line textfield for chat history. Make sure the textfields autoscrolls to the bottom when the content changes
on enter or button push, send a socket message to the server.
the server broadcasts all messages to all clients that are subscribers of the chat group. -
Can we create installer for Java projects ?
when we create any desktop application using swing. Can we create installer for that application that will include all the files, which is required to run that application including data base. Data base is Mysql and in some case it might be MS Access.
We can create the jar files for this and deploy. But other then this ...
Is it possible to create ?? If anybody have idea then plz give me steps how to do this ??
welcome in advance for reply...MukeshSinghRathaur wrote:
when we create any desktop application using swing. Use [Java Web Start|http://www.java.com/en/download/faq/java_webstart.xml] *(<- link)*
..If anybody have idea then plz give me steps how to do this ??Please take the effort to type all 6 letter of the word 'please'. Also - one '?' indicates a question, whereas 2 or more often indicates a bozo.
Do some research, ask a specific question. These forums are not designed as a 'help-desk' where people will hold your hand and tutor you as to how to do things.
Maybe you are looking for
-
More Fun With CSS - (omg its difficult)
First I want to say thank you to everyone that has been helping learn css and all the power that it has. Now this is a two part question. Part 1. (div.header-shadow) I have a div tag that I inserted a very important image into. The image includes so
-
FROM - TO Dates passed from prompt into the Title of the WEBi report
What is the right approach to pass two reporting period dates (FROM /TO) from user's input into the Title(Header) of the Universe based WEBi report, like "Tickets submitted from:MM-DD-YY to:MM-DD-YY" Maybe this is trivial but it is easier to do in CR
-
How many Airport Express do I need?
I have my network setup in the basement. I would like to use AirTunes to listen music upstairs in the 3 bedrooms. Do I need 3 Airport Express? Are there any Speakers that natively support AirTunes? Any other options? Thanks
-
How do i create such a label but with a few lines...
not only on line but many like write a couple of sentences... thanks!
-
How can I stop the auto play feature automatically playing/streaming the next podcast?