Java Code Examples for org.springframework.test.jdbc.JdbcTestUtils#executeSqlScript()
The following examples show how to use
org.springframework.test.jdbc.JdbcTestUtils#executeSqlScript() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DataFixtures.java From dubai with MIT License | 5 votes |
public static void executeScript(DataSource dataSource, String... sqlResourcePaths) throws DataAccessException { JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); for (String sqlResourcePath : sqlResourcePaths) { Resource resource = resourceLoader.getResource(sqlResourcePath); JdbcTestUtils.executeSqlScript(jdbcTemplate, new EncodedResource(resource, DEFAULT_ENCODING), true); } }
Example 2
Source File: ManagerTestCaseSupport.java From base-framework with Apache License 2.0 | 3 votes |
/** * 批量执行sql文件 * * @param dataSource dataSource * @param sqlResourcePaths sql文件路径 * * @throws DataAccessException */ public void executeScript(DataSource dataSource, String... sqlResourcePaths) throws DataAccessException { for (String sqlResourcePath : sqlResourcePaths) { JdbcTestUtils.executeSqlScript(jdbcTemplate, resourceLoader, sqlResourcePath, true); } }
Example 3
Source File: FunctionTestCaseSupport.java From base-framework with Apache License 2.0 | 3 votes |
/** * 批量执行sql文件 * * @param dataSource dataSource * @param sqlResourcePaths sql文件路径 * * @throws DataAccessException */ public static void executeScript(DataSource dataSource, String... sqlResourcePaths) throws DataAccessException { for (String sqlResourcePath : sqlResourcePaths) { JdbcTestUtils.executeSqlScript(jdbcTemplate, resourceLoader, sqlResourcePath, true); } }