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) {
}
@>