Package org.teiid.core.util
Class SqlUtil
- java.lang.Object
-
- org.teiid.core.util.SqlUtil
-
public class SqlUtil extends Object
Utilities for dealing with SQL strings.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SQLExceptioncreateFeatureNotSupportedException()static StringgetKeyword(String sql)static booleanisUpdateSql(String sql)Determines whether a sql statement is an update (INSERT, UPDATE, or DELETE).
-
-
-
Method Detail
-
isUpdateSql
public static boolean isUpdateSql(String sql) throws 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:
IllegalArgumentException- If sql string is invalid and neither a query or an update
-
createFeatureNotSupportedException
public static SQLException createFeatureNotSupportedException()
-
-