org.teiid.core.util
Class SqlUtil

java.lang.Object
  extended by org.teiid.core.util.SqlUtil

public class SqlUtil
extends java.lang.Object

Utilities for dealing with SQL strings.


Field Summary
static char CR_CHAR
           
static char NL_CHAR
           
static char SPACE_CHAR
           
static char TAB_CHAR
           
 
Method Summary
static java.sql.SQLException createFeatureNotSupportedException()
           
static boolean isUpdateSql(java.lang.String sql)
          Determines whether a sql statement is an update (INSERT, UPDATE, or DELETE).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CR_CHAR

public static final char CR_CHAR
See Also:
Constant Field Values

NL_CHAR

public static final char NL_CHAR
See Also:
Constant Field Values

SPACE_CHAR

public static final char SPACE_CHAR
See Also:
Constant Field Values

TAB_CHAR

public static final char TAB_CHAR
See Also:
Constant Field Values
Method Detail

isUpdateSql

public static boolean isUpdateSql(java.lang.String sql)
                           throws java.lang.IllegalArgumentException
Determines whether a sql statement is an update (INSERT, UPDATE, or DELETE). Throws exception if SQL statement appears to be invalid (because it's null, has 0 length, etc.

Parameters:
sql - Sql string
Returns:
True if INSERT, UPDATE, or DELETE, and false otherwise
Throws:
java.lang.IllegalArgumentException - If sql string is invalid and neither a query or an update

createFeatureNotSupportedException

public static java.sql.SQLException createFeatureNotSupportedException()


Copyright © 2011. All Rights Reserved.