Last active
August 28, 2018 09:16
-
-
Save rponte/665155 to your computer and use it in GitHub Desktop.
MyBatis ScriptRunner Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://mybatis.googlecode.com/svn/trunk/src/test/java/org/apache/ibatis/submitted/sptests/SPTest.java | |
Class.forName("org.hsqldb.jdbcDriver"); | |
conn = DriverManager.getConnection("jdbc:hsqldb:mem:sptest", "sa", ""); | |
Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/sptests/CreateDB.sql"); | |
ScriptRunner runner = new ScriptRunner(conn); | |
runner.setDelimiter("]"); | |
runner.setLogWriter(null); | |
runner.setErrorLogWriter(null); | |
runner.runScript(reader); | |
conn.commit(); | |
reader.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
where did u download that? scriptrunner