JdbcTestUtils
instead.@Deprecated public abstract class SimpleJdbcTestUtils extends Object
Constructor and Description |
---|
SimpleJdbcTestUtils()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static int |
countRowsInTable(SimpleJdbcTemplate simpleJdbcTemplate,
String tableName)
Deprecated.
Count the rows in the given table.
|
static int |
deleteFromTables(SimpleJdbcTemplate simpleJdbcTemplate,
String... tableNames)
Deprecated.
Delete all rows from the specified tables.
|
static void |
executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate,
EncodedResource resource,
boolean continueOnError)
Deprecated.
Execute the given SQL script.
|
static void |
executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate,
Resource resource,
boolean continueOnError)
Deprecated.
Execute the given SQL script.
|
static void |
executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate,
ResourceLoader resourceLoader,
String sqlResourcePath,
boolean continueOnError)
Deprecated.
Execute the given SQL script.
|
public static int countRowsInTable(SimpleJdbcTemplate simpleJdbcTemplate, String tableName)
simpleJdbcTemplate
- the SimpleJdbcTemplate with which to perform JDBC operationstableName
- table name to count rows inpublic static int deleteFromTables(SimpleJdbcTemplate simpleJdbcTemplate, String... tableNames)
simpleJdbcTemplate
- the SimpleJdbcTemplate with which to perform JDBC operationstableNames
- the names of the tables from which to deletepublic static void executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate, ResourceLoader resourceLoader, String sqlResourcePath, boolean continueOnError) throws DataAccessException
The script will normally be loaded by classpath. There should be one statement per line. Any semicolons will be removed. Do not use this method to execute DDL if you expect rollback.
simpleJdbcTemplate
- the SimpleJdbcTemplate with which to perform JDBC operationsresourceLoader
- the resource loader (with which to load the SQL scriptsqlResourcePath
- the Spring resource path for the SQL scriptcontinueOnError
- whether or not to continue without throwing an
exception in the event of an errorDataAccessException
- if there is an error executing a statement
and continueOnError was false
public static void executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate, Resource resource, boolean continueOnError) throws DataAccessException
Statements should be delimited with a semicolon. If statements are not delimited with a semicolon then there should be one statement per line. Statements are allowed to span lines only if they are delimited with a semicolon.
Do not use this method to execute DDL if you expect rollback.
simpleJdbcTemplate
- the SimpleJdbcTemplate with which to perform JDBC operationsresource
- the resource to load the SQL script from.continueOnError
- whether or not to continue without throwing an
exception in the event of an error.DataAccessException
- if there is an error executing a statement
and continueOnError was false
public static void executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate, EncodedResource resource, boolean continueOnError) throws DataAccessException
The script will normally be loaded by classpath. There should be one statement per line. Any semicolons will be removed. Do not use this method to execute DDL if you expect rollback.
simpleJdbcTemplate
- the SimpleJdbcTemplate with which to perform JDBC operationsresource
- the resource (potentially associated with a specific encoding)
to load the SQL script from.continueOnError
- whether or not to continue without throwing an
exception in the event of an error.DataAccessException
- if there is an error executing a statement
and continueOnError was false