Spring Framework

org.springframework.test.jdbc
Class JdbcTestUtils

java.lang.Object
  extended by org.springframework.test.jdbc.JdbcTestUtils

public class JdbcTestUtils
extends java.lang.Object

JdbcTestUtils is a collection of JDBC related utility methods for use in unit and integration testing scenarios.

Since:
2.5.4
Author:
Thomas Risberg

Constructor Summary
JdbcTestUtils()
           
 
Method Summary
static boolean containsSqlScriptDelimiters(java.lang.String script, char delim)
          Does the provided SQL script contain the specified delimiter?
static java.lang.String readScript(java.io.LineNumberReader lineNumberReader)
          Read a script from the LineNumberReader and build a String containing the lines.
static void splitSqlScript(java.lang.String script, char delim, java.util.List<java.lang.String> statements)
          Split an SQL script into separate statements delimited with the provided delimiter character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcTestUtils

public JdbcTestUtils()
Method Detail

readScript

public static java.lang.String readScript(java.io.LineNumberReader lineNumberReader)
                                   throws java.io.IOException
Read a script from the LineNumberReader and build a String containing the lines.

Parameters:
lineNumberReader - the LineNumberReader containing the script to be processed
Returns:
String containing the script lines
Throws:
java.io.IOException

containsSqlScriptDelimiters

public static boolean containsSqlScriptDelimiters(java.lang.String script,
                                                  char delim)
Does the provided SQL script contain the specified delimiter?

Parameters:
script - the SQL script
delim - character delimiting each statement - typically a ';' character

splitSqlScript

public static void splitSqlScript(java.lang.String script,
                                  char delim,
                                  java.util.List<java.lang.String> statements)
Split an SQL script into separate statements delimited with the provided delimiter character. Each individual statement will be added to the provided List.

Parameters:
script - the SQL script
delim - character delimiting each statement - typically a ';' character
statements - the List that will contain the individual statements

Spring Framework