runScript() returning null

5 pts.
Tags:
iBATIS
SQL scripts
SQL statements
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")); } }

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following