1

I'm working on integration tests and I'm trying to load SQL scripts to set up the database before a test.

I don't want to use DbUnit since I want to be able to do more than just inserting data and I'm also looking for better performance.

I've tried using JdbcTestUtils from Spring, but it fails when I want to execute a statement like this one:

SELECT setval('member_id_seq', 100000);

So I'm looking for a better solution.

I'm sure there's a library/framework that would allow me to execute any SQL script in Java, but I can't find it. Any suggestions?

p.s. - I'm using PostgreSQL, Spring, JPA/Hibernate

p.p.s. - I know I could also create a wrapper around the PostgreSQL psql command, but it requires having PostgreSQL installed on the continuous integration server and I was hoping I could avoid that.

Fred
  • 741
  • 2
  • 10
  • 22
  • You can just install the postgresql client packages. No need for a whole server. If it's SQL files you want to run, then use the right tool for the job. – Richard Huxton Dec 16 '14 at 19:27

0 Answers0