Invoking jar in Oracle Data integrator

Source: Internet
Author: User

The procedure for invoking the JAR package Java method in ODI is as follows:

1. Write Java code as follows
ImportJava.io.File;ImportJava.io.FileOutputStream;ImportJava.io.OutputStream; Public classFileWriter { Public Static voidWriteFile ()throwsException {//1. Find a fileFile File=NewFile ("D:" + File.separator + "Temp.txt");//2. Instantiating OutputStream objectsOutputStream out=Newfileoutputstream (file); String Info= "Hello world!!!";//the string to outputbyteData[] = Info.getbytes ();//Changing a string into a byte arrayout.write (data);//Output Contentout.close ();}}
2. Compile and package into a jar package

Compile the. Java class from the command line

Create. jar file from the class

d:\>javac filewriter.javad:\>844523) d:\>
3. Copy jar package to C:\Users\<user-name>\AppData\Roaming\odi\oracledi\userlib

比如我的为C:\Users\XQZT\AppData\Roaming\odi\oracledi\userlib

4. Launch ODI, new procedure call jar

The code is as follows

Import OS Import SYS Import FILEWRITERFW=FileWriter () fw.writefile ()
5. Run and verify the process

Reference:

http://karanbalkar.com/2013/06/tutorial-33-using-custom-java-code-in-odi/

Http://shrikantdhagefmw.blogspot.com/2014/05/invoking-jar-in-oracle-data-integrator.html

Http://askankit.blogspot.com/2010/09/call-java-jar-methods-from-odi.html

Invoking jar in Oracle Data integrator

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.