Codota Logo
JdbcTestUtils.executeSqlScript
Code IndexAdd Codota to your IDE (free)

How to use
executeSqlScript
method
in
org.springframework.test.jdbc.JdbcTestUtils

Best Java code snippets using org.springframework.test.jdbc.JdbcTestUtils.executeSqlScript (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: apache/servicemix-bundles

/**
 * Execute the given SQL script.
 * <p>The script will typically be loaded from the classpath. There should
 * be one statement per line. Any semicolons and line comments will be removed.
 * <p><b>Do not use this method to execute DDL if you expect rollback.</b>
 * @param jdbcTemplate the JdbcTemplate with which to perform JDBC operations
 * @param resourceLoader the resource loader with which to load the SQL script
 * @param sqlResourcePath the Spring resource path for the SQL script
 * @param continueOnError whether or not to continue without throwing an
 * exception in the event of an error
 * @throws DataAccessException if there is an error executing a statement
 * and {@code continueOnError} is {@code false}
 * @see ResourceDatabasePopulator
 * @see #executeSqlScript(JdbcTemplate, Resource, boolean)
 * @deprecated as of Spring 4.0.3, in favor of using
 * {@link org.springframework.jdbc.datasource.init.ScriptUtils#executeSqlScript}
 * or {@link org.springframework.jdbc.datasource.init.ResourceDatabasePopulator}.
 */
@Deprecated
public static void executeSqlScript(JdbcTemplate jdbcTemplate, ResourceLoader resourceLoader,
    String sqlResourcePath, boolean continueOnError) throws DataAccessException {
  Resource resource = resourceLoader.getResource(sqlResourcePath);
  executeSqlScript(jdbcTemplate, resource, continueOnError);
}
origin: apache/servicemix-bundles

/**
 * Execute the given SQL script.
 * <p>The script will typically be loaded from the classpath. 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. Any
 * line comments will be removed.
 * <p><b>Do not use this method to execute DDL if you expect rollback.</b>
 * @param jdbcTemplate the JdbcTemplate with which to perform JDBC operations
 * @param resource the resource to load the SQL script from
 * @param continueOnError whether or not to continue without throwing an
 * exception in the event of an error
 * @throws DataAccessException if there is an error executing a statement
 * and {@code continueOnError} is {@code false}
 * @see ResourceDatabasePopulator
 * @see #executeSqlScript(JdbcTemplate, EncodedResource, boolean)
 * @deprecated as of Spring 4.0.3, in favor of using
 * {@link org.springframework.jdbc.datasource.init.ScriptUtils#executeSqlScript}
 * or {@link org.springframework.jdbc.datasource.init.ResourceDatabasePopulator}.
 */
@Deprecated
public static void executeSqlScript(JdbcTemplate jdbcTemplate, Resource resource, boolean continueOnError)
    throws DataAccessException {
  executeSqlScript(jdbcTemplate, new EncodedResource(resource), continueOnError);
}
org.springframework.test.jdbcJdbcTestUtilsexecuteSqlScript

Javadoc

Execute the given SQL script.

The script will typically be loaded from the classpath. 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. Any line comments will be removed.

Do not use this method to execute DDL if you expect rollback.

Popular methods of JdbcTestUtils

  • countRowsInTable
    Count the rows in the given table.
  • deleteFromTables
    Delete all rows from the specified tables.
  • deleteFromTableWhere
    Delete rows from the given table, using the provided WHERE clause.If the provided WHERE clause conta
  • dropTables
    Drop the specified tables.
  • countRowsInTableWhere
    Count the rows in the given table, using the provided WHERE clause.If the provided WHERE clause cont
  • readScript
    Read a script from the provided LineNumberReader, using the supplied comment prefix, and build a Str
  • splitSqlScript

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now