mxhdev / SQLChecker

GNU General Public License v3.0
1 stars 1 forks source link

Implement sql script execution #4

Closed mxhdev closed 8 years ago

mxhdev commented 8 years ago

Implement execution of reset sql script. This script should be defined for every assignment / solution.

After checking one submission, the reset script should be executed in order to reset the database and make sure that each submission gets tested on the same dataset.

mxhdev commented 8 years ago

It appears, that there is no native solution for executing a sql script. However, there are some sample implementations which can be helpful.

First Solution

ibatis ScriptRunner class http://www.mkyong.com/jdbc/how-to-run-a-mysql-script-using-java/ https://gist.github.com/joe776/831762

Second Solution

Native with already implemented classes Use the already created fileReader classes and define the content of a reset.sql file with tags. Run Execute() for each query/tag This would be a "native" solution without depending on any external library

mxhdev commented 8 years ago

SQL Scripts can be executed via the ScriptReader class since commit 8c05fdc