Running ssh from within java program
Hi!
I am trying to start ssh from within java e.g.:
Runtime run = Runtime.getRuntime();
Process pro = run.exec("ssh -l xx 12.12.12.12");
But it complains:
socket: Operation not permitted
ssh: connect to host 12.12.12.12 port 22: Operation not permitted
Running ssh from the command prompt works just fine. It's run on win xp.
What is the problem, and how can I avoid it?
Endre
Afraid not. I think maybe it's related to security permissions, but I am really not sure. If you can help, I would appreciate it.
- Endre
Similar Messages
-
Running Tomcat from a java program
I'm writing a program that shall run Tomcat from the program itself. The eacy way would be to just call org.apache.catalina.startup.Bootstrap.main(String[]) in a new thread, but that gives only a little information to the program about the state of the server. Actually I would only know when the server is told to start (just before the main method is called), and when the server had stopped (just after the main method).
I have browsed the Catalina API documentation and source code for hours, but the only solution I have gotten, writes the standard startup text:
Starting service Tomcat-Standalone
Apache Tomcat/4.0.4
Starting service Tomcat-Apache
Apache Tomcat/4.0.4If I could get that to work, I would could add a LifecycleListener, and get all the info. I need.
The essence of the code I use is this:
CatalinaService cs = new org.apache.catalina.startup.CatalinaService();
Server s = new StandardServer();
StandardService stdService = new org.apache.catalina.core.StandardService();
s.addService(stdService);
cs.setServer(s);
cs.process(new String[]{"start"});but the following also produce a simmilar result:
BootstrapService b = new org.apache.catalina.startup.BootstrapService();
b.load(new TomcatLoader(),null);
b.start();A dirty solution would be to copy the code form Bootstrap.main(String[]) and add a few lines, but I really dosn't like that. It would be a nightmare to maintain, primiarry because I would loose the functionallity of Catalinas class loader (where a lof of classes is loaded).
Does anybody know how I can get Tomcat to run, so I still get my info. and don't use any dirty solutions?Check out the main method in the source code of class org.apache.catalina.startup.Embedded
It should help you.
Also check out this article
http://www.onjava.com/pub/a/onjava/2002/04/03/tomcat.html -
Running curl command from a java program using Runtime.getRuntime.exec
for some reason my curl command does not run when I run it from within my java program and errors out with "https protocol not supported". This same curl command however runs fine from any directory on my red hat linux system.
To debug the problem, I printed my curl command from the java program before calling Runtime.getRuntime.exec command and then used this o/p to run from the command line and it runs fine.
I am not using libcurl or anything else, I am running a simple curl command as a command line utility from inside a Java program.
Any ideas on why this might be happening?thanks a lot for your response. The reason why I am using curl is because I need to use certificates and keys to gain access to the internal server. So I use curl "<url> --cert <path to the certificate>" --key "<path to the key>". If you don't mid could you please tell me which version of curl you are using.
I am using 7.15 in my system.
Below is the code which errors out.
public int execCurlCmd(String command)
String s = null;
try {
// run the Unix "ps -ef" command
Process p = Runtime.getRuntime().exec(command);
BufferedReader stdInput = new BufferedReader(new
InputStreamReader(p.getInputStream()));
BufferedReader stdError = new BufferedReader(new
InputStreamReader(p.getErrorStream()));
// read the output from the command
System.out.println("Here is the standard output of the command:\n");
while ((s = stdInput.readLine()) != null) {
System.out.println(s);
// read any errors from the attempted command
System.out.println("Here is the standard error of the command (if any):\n");
while ((s = stdError.readLine()) != null) {
System.out.println(s);
return(0);
catch (IOException e) {
System.out.println("exception happened - here's what I know: ");
e.printStackTrace();
return(-1);
} -
How to run a openssl command from a java program
Hi All
Please suggest on how to run a openssl command from a java program.
I am using this
Runtime runtime = Runtime.getRuntime();
runtime.exec("openssl pkcs8 -inform der -nocrypt test.der result.pem");
This is suppose to take test.der as input and create result.pem.
There are no errors but the file result.pem isnt created.
Thanks in AdvanceFirst off is that openssl command correct? Should it be this instead:
openssl pkcs8 -inform der -nocrypt -in test.der -out result.pem
Try out your openssl command within a command prompt so that you know that it works ok. I think the command line you specified waits on stdin (well it does for me).
After that.....
runtime.exec creates a Process object. If you do this:
Process openssl = runtime.exec("....")
then you can examine the return code from openssl to see the exit code - for instance if the input file does not exist then exit = 1. You can test for this with Java
Alternatively you could get the stderr from the process and look inside it - if it is 0 length then all is good, if it has some text in there then it has likely failed. You could then throw an exception and include the stderr output in the exception messgae. You may need to experiment with this, runnig it first when openssl is happy then running it again when openssl is upset.
M -
How to execute unix command from the Java program running on Windows
Hello,
I need to
1. Execute a unix shell script from a Java program running on the Windows.
2. I also need to capture the output of this shell script in my program.
Please suggest me how to achieve this.
Thanks in Advance.Hi...
Something is missing here
If you want to execute a shell script in windows that not posible unless you find or develop a unix shell script parser for windows.
But if you are trying the execute a unix shell script on a remote unix computer from your java program running on a windows platform you can do that by logging on to the UNIX terminal which is running on port 23 I think.
You can test this using telnet tool on windows
just type on command prompt
telnet <ip of the unix pc> <port number this case 23>
you should get the unix terminal. If that works you can do the same through java or you can directly conect to port 23 of that pc using sockets that way your program will be platform independant -
How to run a cygwin.bat from a java program?
Can you please let me know how to run a cygwin.bat file from a java program and to give commands through java program. I have a program to run .exe files, but when I do the same for the cygwin.bat it doesnt work. In task mgr a BASH and a cmd.exe is running. Please help me on this & bit urgent. Thanks in advance!
Can you please let me know how to run a cygwin.bat
file from a java program and to give commands through
java program. I have a program to run .exe files, but
when I do the same for the cygwin.bat it doesnt work.Of course not. .bat files are no native executables. You need to open a shell first, like "cmd /c cygwin.bat ..."
& bit urgent. Thanks in advance!If I had read this earlier I wouldn't have replied. Why exactly is your time worth more than anybody else's? -
How to compile and run a .java file from another java program
hello,
can any one tell me how to compile and run a *.java* file from another java program which is not in same directory?Well a smarter way of implementing this is by using a solution provided by Java Itself.
If you are using J2SE 6.0+ there is an in built solution provided along with JDK itself and inorder to go ahead with solution the below are set of API which you;d be using it for compiling Java Programs (Files)
http://java.sun.com/javase/6/docs/api/javax/tools/package-summary.html
How do i do that ??
Check out the below articles which would help you of how to do that
http://www.ibm.com/developerworks/java/library/j-jcomp/index.html
http://www.javabeat.net/javabeat/java6/articles/java_6_0_compiler_api_1.php
http://books.google.com/books?id=WVbpv8SQpkEC&pg=PA155&lpg=PA155&dq=%22javax+tools%22+compiling+java+file&source=web&ots=XOt0siYe-f&sig=HH27ovuwvJgklIf8omTykUmy-eM
Now once we are done with compilation.In order to run a Specific class all you ought to do is create an object and its specific methods of a specified class included in the CLASSPATH which you can manage it easily by usage little bit reflections.
Hope that might help :)
REGARDS,
RaHuL -
How to run a remote application (Non Java) from a Java program
Could you please tell me how to run a remote application (Non-Java) from a Java program without using RMI. Please tell me know the procedure and classes to be used.
Cheers
Ramwhat do you mean remote application.In the other pc or in your pc just apart from you application?
If the application is in your pc,the method which the upper has mentioned is
a good one!
But if the application you want to run is not in your computer,the method can't do. And you can use socket with which you can build an application listening some port in the pc which contains the application you want to run .When you want to run that application ,send the Start_Command to the listening application.Then listening application will run the application with the help of the method the upper mentioned. -
Running a Linux command "clear" from a Java program
Hello. How to run a simple linux command to clear the screen from a Java program. I did the following
Process p = Runtime.getRuntime().exec("clear");
Nothing is happening.you're not supposed to mess with the shell, youdon't own it and
shouldn't try to dictate what happens with it.
The shell is a multiuser system,What?
The command shell (for example sh, ksh, bash, csh,
zsh) is a process, a command interpeter just like any
other (user mode) program.
yes, and there can be multiple processes writing to it at any one time.
You do NOT have exclusive access to it, nor should you ever assume you do.
In a multiuser system there can be several shells
running on behalf of several users. The same user can
run several shells.
Yes, and each shell can be accessed by multiple processes at any one time.
So what?
Process a writes to the shell.
Process b writes to the shell.
Process a clears the shell, removing whatever process b wrote there.
You've just messed up process b, or at the very least its output.
Do NOT assume you have exclusive access to any shell. -
Trying to use grep from within java,using exec command!
Hi all!
I would like to run a grep function on some status file, and get a particular line from it, and then pipe this line to another file.
Then perfom a grep on the new file to check how many of the lines above are present in that file, and then write this value to a new file.
The final file with a numerical value in it, i will read from within java,as one reads normal files!
I can run simple commands using exec, but am kinda stuck with regards to the above!
Maybe i should just do all the above from a script file and then run the script file from exec. However, i dont want to do that, because it kinda makes the system dependent,..what if i move to a new machine, and forget to install the script, then my program wont work!
Any advise?
Thanks
RegardsWith a little creativity, you can actually do all that from the command line with a single command. It'll look a little crazy, but it can be done.
Whether the script exists on the local machine or not has zero to do with platform indpendence. You assumedly have to get the application onto the local machine, so including the script is not really an issue at all. However, you're talking about system independence, yet still wishing to run command line arguments? The two are mutually exclusive. -
Calling an executable from a java program
How can I call a compiled program from a java program. I have a fortran program, which I would like to call for execution from within my java program. My OS is linux.
Thanks,
AnNot quite sure in the case of fortran program, but one thing can be done, call ur fortran program from a batch (.bat file) and call this .bat file from java ;
try {
Process p = Runtime.getRuntime().exec("run.bat");
p.waitFor();
catch( Exception e ) {
} -
Executing a perl script from within java application
Hi,
Does anyone knows a way to execute a perl script from within java.
---kirkRuntime.exec("perl myscript.pl");
Of course whether that "works" depends on what the script does and where the java program runs. -
Executing an HTML file from within Java
My program produces a file of run statistics formatted as html (stats.htm).
I want to execute this file in a browser from within my program - ie. call a browser with this file as a parm.
How do I do that ?
Have tried executing a DOS command for the form "cmd /C fullpathname-of-file" but it does nothung.
Thanks
...KenRThank you very much...that worked file.
The relevant code is:
String arg = "G:/tma03/agents/stats.htm";
java.awt.Desktop desktop = java.awt.Desktop.getDesktop(); ...to set-up Desktop object
try ... to create a URI object using arg
java.net.URI uri = new java.net.URI( arg );
desktop.browse( uri ); ... to browse the URI
} -
How to start java.exe from a java program in windows ?
Hi,
I did like to know, if its possible to run java.exe from a java program on windows ? The java.exe should be visible from checking the processes that are currently running using the Task Manager on windows.Runtime.getRuntime().exec("java Sample");
-
How to have an Oracle procedure send and receive value from a java program.
The below procedure is place inside a package. This procedure "get_extract_ready_headers " is selecting columns store_number, terminal_number, tran_number, tran_date, cust_id from the source REX_HEAD_EXTRACT table. This information is selected into a ref cursor. The data has cust_id field which is encrypted. How do I modify the procedure get_extract_ready_headers and accomplish 2 things?
1. Make this procedure to read the "cust_id" value from the source table and send the value to a Java program "getheaderinfo" (this java program decrypts the cust_id field).
2. When we get the unencrypted value back from the Java program, make the procedure accept this decrypted value and use it to update CUST_ID value in the target table TRAN_HEAD table. I am using Oracle 11.2.0.2, and TOAD 10.5.1.3.
-- Procedural code
PROCEDURE get_extract_ready_headers (p_records OUT SYS_REFCURSOR)
IS
BEGIN
OPEN p_records FOR
SELECT store_number, terminal_number, tran_number, tran_date, cust_id FROM REX_HEAD_EXTRACT;
END;--Table Structure for source table REX_HEAD_EXTRACT
CREATE TABLE REX_HEAD_EXTRACT
REX_SEQ_NBR NUMBER(20),
REVISION_NUMBER NUMBER,
DAY NUMBER(3),
RESA_TRAN_SEQ_NO NUMBER(20),
BUSINESS_DATE DATE,
TRAN_SEQ_NBR NUMBER(12),
ORG_NUMBER NUMBER,
STORE_NUMBER NUMBER,
TRAN_DATE DATE,
TERMINAL_NUMBER NUMBER,
TRAN_NUMBER NUMBER,
TRAN_TIME DATE,
BATCH_NUMBER VARCHAR2(8 BYTE),
BATCH_TYPE VARCHAR2(4 BYTE),
TRAN_TYPE VARCHAR2(4 BYTE),
SUB_TRAN_TYPE VARCHAR2(4 BYTE),
CLERK_CODE VARCHAR2(15 BYTE),
TRAN_TAXABLE_AMOUNT NUMBER(12,2),
TRAN_TAX_TOTAL NUMBER(12,2),
TRAN_GROSS_TOTAL NUMBER(12,2),
COUP_TOTAL NUMBER(9,2),
MKD_TOTAL NUMBER(9,2),
EMPLOYEE_NUMBER VARCHAR2(15 BYTE),
EMPLOYEE_NAME VARCHAR2(40 BYTE),
TRAN_ALTTAXABLE_AMOUNT NUMBER(12,2),
TRAN_ALTTAX_TOTAL NUMBER(12,2),
SALE_AMOUNT NUMBER(9,2),
RETURN_AMOUNT NUMBER(9,2),
RETURNED_AMOUNT NUMBER(9,2),
NETCASH NUMBER(12,2),
TENDER_CODE VARCHAR2(4 BYTE),
MULT_RCPT VARCHAR2(1 BYTE),
SPLIT_TENDER VARCHAR2(1 BYTE),
RTN_WITH_PURCHASE VARCHAR2(1 BYTE),
RTN_WITH_RCPT VARCHAR2(1 BYTE),
REASON_CODE VARCHAR2(4 BYTE),
PASSWORD VARCHAR2(10 BYTE),
RINGTIME DATE,
CUST_NUMBER VARCHAR2(12 BYTE),
CUST_ID VARCHAR2(50 BYTE),
ZIP_CODE NUMBER,
POSTAL_CODE VARCHAR2(9 BYTE),
PV_TIME_LAPSE NUMBER,
ORIG_STORE_NBR NUMBER,
ORIG_TRAN_DATE DATE,
ORIG_TRAN_TYPE VARCHAR2(4 BYTE),
ORIG_TERM_NBR NUMBER,
ORIG_TRAN_NBR NUMBER,
ORIG_SALE_AMT NUMBER(12,2),
ORIG_TENDER_CODE VARCHAR2(4 BYTE),
ORIG_CLERK_CODE VARCHAR2(15 BYTE),
PREV_TRAN_TYPE VARCHAR2(4 BYTE),
PREV_SUB_TRAN_TYPE VARCHAR2(4 BYTE),
GIFT_REGISTRY_ID VARCHAR2(25 BYTE),
NO_OF_ITEMS NUMBER,
TAX_EXEMPT_ID VARCHAR2(18 BYTE),
TRAN_RINGTIME NUMBER,
AUDITED VARCHAR2(1 BYTE),
BATCH_VERSION NUMBER(9,2),
BATCH_SOURCE VARCHAR2(5 BYTE),
CREATE_DATE DATE,
CREATE_ID VARCHAR2(32 BYTE),
CREATE_PROC VARCHAR2(32 BYTE),
MOD_DATE DATE,
MOD_ID VARCHAR2(32 BYTE),
MOD_PROC VARCHAR2(32 BYTE),
TERMINAL_GROUP NUMBER,
USER_DEF_1 NUMBER,
USER_DEF_2 NUMBER,
USER_DEF_3 NUMBER,
USER_DEF_4 NUMBER(12,2),
USER_DEF_5 NUMBER(12,2),
USER_DEF_6 NUMBER(12,2),
USER_DEF_7 VARCHAR2(50 BYTE),
USER_DEF_8 VARCHAR2(50 BYTE),
USER_DEF_9 VARCHAR2(50 BYTE),
MANAGER_NUMBER VARCHAR2(15 BYTE),
MANAGER_REASON_CODE VARCHAR2(10 BYTE),
MANAGER_SWIPED VARCHAR2(1 BYTE),
PHONE_NO NUMBER(11),
KCPOS_KTH_USER_101 NUMBER,
KCPOS_KTH_USER_102 NUMBER,
KCPOS_KTH_USER_103 NUMBER,
KCPOS_KTH_USER_104 NUMBER,
KCPOS_KTH_USER_105 NUMBER,
KCPOS_KTH_USER_106 NUMBER,
KCPOS_KTH_USER_107 NUMBER,
KCPOS_KTH_USER_108 NUMBER,
KCPOS_KTH_USER_109 NUMBER,
KCPOS_KTH_USER_110 NUMBER,
KCPOS_KTH_USER_201 NUMBER(12,2),
KCPOS_KTH_USER_202 NUMBER(12,2),
KCPOS_KTH_USER_203 NUMBER(12,2),
KCPOS_KTH_USER_204 NUMBER(12,2),
KCPOS_KTH_USER_205 NUMBER(12,2),
KCPOS_KTH_USER_206 NUMBER(12,2),
KCPOS_KTH_USER_207 NUMBER(12,2),
KCPOS_KTH_USER_208 NUMBER(12,2),
KCPOS_KTH_USER_209 NUMBER(12,2),
KCPOS_KTH_USER_210 NUMBER(12,2),
KCPOS_KTH_USER_301 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_302 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_303 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_304 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_305 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_306 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_307 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_308 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_309 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_310 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_401 DATE,
KCPOS_KTH_USER_402 DATE,
KCPOS_KTH_USER_403 DATE,
DISC_TOTAL NUMBER(9,2)
CREATE INDEX REX_HEAD_EXTRACT_NDX ON REX_HEAD_EXTRACT
(REX_SEQ_NBR, REVISION_NUMBER, STORE_NUMBER, TRAN_DATE, TERMINAL_NUMBER, TRAN_NUMBER)-- Create table DDL for target table TRAN_HEAD
CREATE TABLE NAVISTOR.KCPOS_TRAN_HEADER_BASE
TRAN_SEQ_NBR NUMBER(12),
ORG_NUMBER NUMBER,
STORE_NUMBER NUMBER,
TRAN_DATE DATE,
TERMINAL_NUMBER NUMBER,
TRAN_NUMBER NUMBER,
TRAN_TIME DATE,
BATCH_NUMBER VARCHAR2(8 BYTE),
BATCH_TYPE VARCHAR2(4 BYTE),
TRAN_TYPE VARCHAR2(4 BYTE),
SUB_TRAN_TYPE VARCHAR2(4 BYTE),
CLERK_CODE VARCHAR2(15 BYTE) NOT NULL,
TRAN_TAXABLE_AMOUNT NUMBER(12,2),
TRAN_TAX_TOTAL NUMBER(12,2),
TRAN_GROSS_TOTAL NUMBER(12,2),
COUP_TOTAL NUMBER(9,2),
MKD_TOTAL NUMBER(9,2),
EMPLOYEE_NUMBER VARCHAR2(15 BYTE),
EMPLOYEE_NAME VARCHAR2(40 BYTE),
TRAN_ALTTAXABLE_AMOUNT NUMBER(12,2),
TRAN_ALTTAX_TOTAL NUMBER(12,2),
SALE_AMOUNT NUMBER(9,2),
RETURN_AMOUNT NUMBER(9,2),
RETURNED_AMOUNT NUMBER(9,2),
NETCASH NUMBER(12,2),
TENDER_CODE VARCHAR2(4 BYTE),
MULT_RCPT VARCHAR2(1 BYTE),
SPLIT_TENDER VARCHAR2(1 BYTE),
RTN_WITH_PURCHASE VARCHAR2(1 BYTE),
RTN_WITH_RCPT VARCHAR2(1 BYTE),
REASON_CODE VARCHAR2(4 BYTE),
PASSWORD VARCHAR2(10 BYTE),
RINGTIME DATE,
CUST_NUMBER VARCHAR2(12 BYTE),
CUST_ID VARCHAR2(50 BYTE) ENCRYPT USING 'AES256' NO SALT,
ZIP_CODE NUMBER,
POSTAL_CODE VARCHAR2(9 BYTE),
PV_TIME_LAPSE NUMBER,
ORIG_STORE_NBR NUMBER,
ORIG_TRAN_DATE DATE,
ORIG_TRAN_TYPE VARCHAR2(4 BYTE),
ORIG_TERM_NBR NUMBER,
ORIG_TRAN_NBR NUMBER,
ORIG_SALE_AMT NUMBER(12,2),
ORIG_TENDER_CODE VARCHAR2(4 BYTE),
ORIG_CLERK_CODE VARCHAR2(15 BYTE),
PREV_TRAN_TYPE VARCHAR2(4 BYTE),
PREV_SUB_TRAN_TYPE VARCHAR2(4 BYTE),
GIFT_REGISTRY_ID VARCHAR2(25 BYTE),
NO_OF_ITEMS NUMBER,
TAX_EXEMPT_ID VARCHAR2(18 BYTE),
TRAN_RINGTIME NUMBER,
AUDITED VARCHAR2(1 BYTE),
BATCH_VERSION NUMBER(9,2),
BATCH_SOURCE VARCHAR2(5 BYTE),
CREATE_DATE DATE,
CREATE_ID VARCHAR2(32 BYTE),
CREATE_PROC VARCHAR2(32 BYTE),
MOD_DATE DATE,
MOD_ID VARCHAR2(32 BYTE),
MOD_PROC VARCHAR2(32 BYTE),
TERMINAL_GROUP NUMBER,
USER_DEF_1 NUMBER,
USER_DEF_2 NUMBER,
USER_DEF_3 NUMBER,
USER_DEF_4 NUMBER(12,2),
USER_DEF_5 NUMBER(12,2),
USER_DEF_6 NUMBER(12,2),
USER_DEF_7 VARCHAR2(50 BYTE),
USER_DEF_8 VARCHAR2(50 BYTE),
USER_DEF_9 VARCHAR2(50 BYTE),
MANAGER_NUMBER VARCHAR2(15 BYTE),
MANAGER_REASON_CODE VARCHAR2(10 BYTE),
MANAGER_SWIPED VARCHAR2(1 BYTE),
PHONE_NO NUMBER(11),
KCPOS_KTH_USER_101 NUMBER,
KCPOS_KTH_USER_102 NUMBER,
KCPOS_KTH_USER_103 NUMBER,
KCPOS_KTH_USER_104 NUMBER,
KCPOS_KTH_USER_105 NUMBER,
KCPOS_KTH_USER_106 NUMBER,
KCPOS_KTH_USER_107 NUMBER,
KCPOS_KTH_USER_108 NUMBER,
KCPOS_KTH_USER_109 NUMBER,
KCPOS_KTH_USER_110 NUMBER,
KCPOS_KTH_USER_201 NUMBER(12,2),
KCPOS_KTH_USER_202 NUMBER(12,2),
KCPOS_KTH_USER_203 NUMBER(12,2),
KCPOS_KTH_USER_204 NUMBER(12,2),
KCPOS_KTH_USER_205 NUMBER(12,2),
KCPOS_KTH_USER_206 NUMBER(12,2),
KCPOS_KTH_USER_207 NUMBER(12,2),
KCPOS_KTH_USER_208 NUMBER(12,2),
KCPOS_KTH_USER_209 NUMBER(12,2),
KCPOS_KTH_USER_210 NUMBER(12,2),
KCPOS_KTH_USER_301 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_302 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_303 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_304 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_305 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_306 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_307 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_308 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_309 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_310 VARCHAR2(50 BYTE),
KCPOS_KTH_USER_401 DATE,
KCPOS_KTH_USER_402 DATE,
KCPOS_KTH_USER_403 DATE,
DISC_TOTAL NUMBER(9,2),
RTA_RTN_AUTCOD VARCHAR2(4 BYTE),
RTA_RTN_COMMID NUMBER,
RTA_RTN_EVNTID NUMBER,
RTA_RTN_QTY NUMBER,
RTA_RTN_RCPT_SCAN VARCHAR2(1 BYTE),
RTA_RTN_REFUND_AMT NUMBER(9,2),
RTA_RTN_TYPE_CODE VARCHAR2(4 BYTE),
RTA_RTN_WITH_RCPT VARCHAR2(1 BYTE),
RTA_RTN_COUNT INTEGER,
SDEDVAL1 VARCHAR2(50 BYTE)
)--sample data
REX_SEQ_NBR,REVISION_NUMBER,DAY,RESA_TRAN_SEQ_NO,BUSINESS_DATE,TRAN_SEQ_NBR,ORG_NUMBER,STORE_NUMBER,TRAN_DATE,TERMINAL_NUMBER,
TRAN_NUMBER,TRAN_TIME
478,1,11,12024005,6/11/2012,,1,692,6/11/2012,155,5,6/11/2012 12:57:17 PM,
479,1,11,12024006,6/11/2012,,1,692,6/11/2012,155,6,6/11/2012 2:01:51 PM,
480,1,11,12024007,6/11/2012,,1,692,6/11/2012,155,7,6/11/2012 2:47:10 PMAssuming that SomeJavePgm is a Java stored function (not a Java program running outside the database) and that it takes as a parameter whatever data type CUST_ID is in TABLE_A (hopefully RAW but potentially VARCHAR2) and returns a string, you would call it just as you would a PL/SQL stored function
INSERT INTO table_b( cust_id, <<other columns>> )
SELECT SomeJavaPgm( a.cust_id ), <<other columns>>
FROM table_a aIf SomeJavePgm is not a Java stored procedure, calling it from PL/SQL becomes much more complicated. You would need whatever machine hosts this program to expose an appropriate API (for example, a web service interface) that you could invoke via UTL_HTTP). You'd need to tell us what that API was, however.
Justin
Maybe you are looking for
-
How to setup NLS_LANG on Windows XP
Hi, We have an oracle database with character set AMERICAN_AMERICA.US7ASCII setting. and our production application inserts different language characters directly to the database without any UTF8 conversion. Another function has been coded which can
-
How do I do a one way sync from contacts in computer (Outlook), to contacts on I pad (also for I-phone)? Contacts on I-Pad are incorrect and I do not want to add them back to my computer? Alternatively, is there any way to delete contact groups all
-
I have written a Java cross platform program that counts the frequency of words in a given text. I output a list with the words and their frequency to a JTextArea as well as to a text file. The program works fine but I still have a problem. My text i
-
Field is in DB table/alias but I get ORA904 error using it in OBIEE Answers
Hello, I'm very new at developing with RPD and OBIEE tools, so I'm struggling with something that I thought I did correctly. I added a new field to a database table, and can query it in the database. I added it to the table in RPD Physical layer and
-
Je me permets de vous contacter pour un problème de programme sur lequel je bute depuis une semaine. Vous trouverez en fichier le programme sous labView 2009. Pour résumé, ce programme fait l'acquisition de trois tensions analogiques et une entrée n