Hi All,
Can anybody please help me with how can i call my java program from shell and also pass parameter along with it so that the program can interpret the value/int and update the database.
...
Can anybody please help me with how can i call my java program from shell and also pass parameter along with it so that the program can interpret the value/int and update the database.
...
Calling a Java program is as simple as passing the class file to the Java application launcher tool (which is called "java").
I shall assume that you have either created a source file and compiled it into a ".class" file, or obtained a compiled file from somewhere else. In either case, you have a ".class" file with you.
You run the program by doing so -
Here's a Java program that simply displays the parameters passed to it:
About "updating the database" - that is a very broad topic. Java programs typically make use of JDBC to interact with a database. There are a lot of things you need to take care of while doing JDBC programming, and it's something a book would explain better than me.
I suggest you go through Sun's JDBC Tutorial to get an idea of JDBC - The Java™ Tutorials
Or better still, you may want to buy a good book on JDBC from your favorite bookstore.
HTH,
tyler_durden
Last edited by durden_tyler; 05-17-2010 at 01:30 PM..
This User Gave Thanks to durden_tyler For This Post:
I can't seem to get this right. I've tried it every way imaginable using every trick I see on stackexchange and such. No luck. So nothing major here, something like:
#!/bin/bash
SEARCH="ARG1 ARG2 '((^EXACT$)|(.*InTheMiddle*)|(^AtBeginning*))'"
java -cp /my/class/path MyClassName $SEARCH... (3 Replies)
I have the below script triggered daily at 330am in the morning, since last 7 days job not writing anything to database.
below impala shell calling shell file which has sql , it is extracting data and loads to a flat file txt file. which is going wrong for last 1 week.
need help, echo... (2 Replies)
Hello..
I am developing a Graphical User Interface using GTK. As part of our project I need to take inputs from GTK entries and pass those inputs to shell script and use them in shell script. The problem which struck me is only limited number of inputs are getting passed to shell script. For now... (14 Replies)
Hi,
I'm trying to test one unix shell script in dev environment. But I'm not sure how to pass the environment in my java program calling code. I'm trying to use -DconsumerEnv="DEV" but unfortunately I get 'null' while trying to print the value from java class.
System.out.println("Environment: "+... (4 Replies)
Hi,
I,m writing a program in shell script and currently this script is calling a java program.
I have a problem to pass string variable from my shell script to the java program. I don't know on how to pass it and how the java program can call what I have pass from the shell script.
This is... (3 Replies)
I have a java program to validate a XML file. I want to call this java program in a shell script which will be registered as concurrent program in oracle apps.
Can anyone please let me know the step by step appraoch required to call java program in shell script like ....intial steps... (1 Reply)
Hi,
Could anybody please let me know how to call a C_Program
from shell script. I know through command "system" we can call
shell script from C program.
Awaiting response.
Thanks and regards,
Chanakya M (4 Replies)
Hi,
I want to call multiple java commands through a .sh file. I have drafted one with my least knowledge. But its not working. Pls help. I am trying to run this from Sun Solaris (OS 5.10) server with 10g oracle database.
echo \* starting script AUTORUN
echo \* get the Monitor path... (4 Replies)
Hi All,
I am new to shell script, just wanted you guy to help.
How do i call a java program by using shell script, pls give some samle code for it,
thank you ver much. (2 Replies)
Hi,
I have a variable called asOfDate in shell script.
I need to pass it as a command line argument to a java command which will be called from the same shell script.
The format of that variable is "MM/DD/YYYY"
while doing echo, it is printing correctly in the java command.
ie.... (0 Replies)