1

Is there a way to run an external sql script using the SessionFactory ? I know there is a way to specify raw sql but is there a way to run a .sql file ?

3
  • What is the purpose? You could run sql file through hibernate.xml Commented Apr 24, 2015 at 6:33
  • I have tried to do session.createSQLQuery("BEGIN"+content+ "END").executeUpdate(); but no success but using entity manager you can achieve same thing please visit this stackoverflow.com/questions/14358425/… Commented Apr 24, 2015 at 9:35
  • I wanted to do this a a part of my test suite. I have a testNG suite from which I want to run my application against multiple test data sets. I am using HSQL embeddeddatabase and would have to run a new file in the BeforeSuite. Commented Apr 24, 2015 at 16:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.