5 pts.
 runScript() returning null
Hello to all of the participants. This is my first blog. This is a program to execute .sql file which contains bunch of sql statements. I have used iBatis package it's compling and executing with out any mistakes, but resulting nothing. I have tried in both 2.3 and 2.0 release also. Can any one make the required correct. import java.sql.*; import com.ibatis.common.jdbc.ScriptRunner; import java.io.*; import com.ibatis.common.resources.Resources; public class JConn { public static void main(String[] args) throws SQLException { try { Connection con = null; DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:orcl","scott","tiger"); con.commit(); ScriptRunner sr = new ScriptRunner(con,false,false); FileReader fr = new FileReader(new File("D:/scripts.sql")); sr.setLogWriter(null); sr.setErrorLogWriter(null); sr.runScript(fr); //sr.runScript(Resources.getResourceAsReader("scripts.sql")); } }

Software/Hardware used:
ASKED: June 1, 2009  1:13 PM
UPDATED: June 1, 2009  1:51 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _