org.kuali.db
Class SqlSplitter

java.lang.Object
  extended by org.kuali.db.SqlSplitter

public class SqlSplitter
extends Object

Utility class to split a long sql batch script into single SQL commands.


Field Summary
static int NO_END
          Value indicating the sql has no end-delimiter like i.e.
 
Constructor Summary
SqlSplitter()
           
 
Method Summary
static int containsSqlEnd(String line, String delimiter)
          Check if the given sql line contains an end of command ';' Please note that we do not fully parse the SQL, so if we get a malformed statement, we cannot detect it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_END

public static final int NO_END
Value indicating the sql has no end-delimiter like i.e. semicolon

See Also:
Constant Field Values
Constructor Detail

SqlSplitter

public SqlSplitter()
Method Detail

containsSqlEnd

public static int containsSqlEnd(String line,
                                 String delimiter)
Check if the given sql line contains an end of command ';' Please note that we do not fully parse the SQL, so if we get a malformed statement, we cannot detect it.

Parameters:
line - to parse
delimiter - which should be used to split SQL commands
Returns:
position after the end character if the given line contains the end of a SQL script, if it doesn't contain an end char.


Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.