Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ODI Procedure using JavaBeanShell

VivekkumarManiraoJul 11 2013 — edited Jul 11 2013

I am trying to create a ODI Procedure using JavaBean shell with the following program.

The logic of this one is select data from dual and write to a file.

The execution of this program is OK , but it does not write any data to the file.

If any one can help me that how do i can acheive this logic? It will be very help full

<@
import java.io.*;
import java.sql.*;
import java.lang.*;
try {

Connection myCon = snpRef.getJDBCConnection("SRC");
Statement myStmt = myCon.createStatement();
ResultSet  rs = myStmt.executeQuery("select 'Hello'  from dual");
rs.next();
String myString = rs.getString(1);
String mypath="D:\test_1\ODI\test.txt";
File file = new File(mypath);
FileWriter fw = new FileWriter(file.getAbsoluteFile());
BufferedWriter bw = new BufferedWriter(fw);
bw.write(content);
bw.close();


rs.close();
myStmt.close();
myCon.close();

} catch (Exception e) {


}

@>

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 8 2013
Added on Jul 11 2013
4 comments
492 views