public class Util extends Object
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static String |
checkSQLName(String string, int maxStringLength)
Checks for any illegal characters in a SQL name.
|
static boolean |
compareDates(Object o1, Object o2)
Returns true if two given objects (either a Date object or a String representation of a Date object) are the same.
|
static String |
enquoteColumnName(Connection conn, String columnName)
Enquotes a column name.
|
static String |
enquoteLiteral(Connection conn, String name)
This method enquotes a literal value.
|
static String |
enquoteLiteral(Connection conn, String literal, int maxLengthAllowed)
Returns the enquoted literal
|
static String |
enquoteNameSQLName(Connection conn, String name)
Returns the ENQUOTE_NAME formatted String for the SQL name If the Oracle JDBC is present, use the new OracleStatement.enquoteIdentifier API in the JDK8 JDBC.
|
static String |
enquoteTableName(Connection conn, String tableName)
Enquotes a table name with or without schema name which is separated by ".".
|
static int |
getMaxLengthAllowed() |
static String |
getValidatedGraphName(Connection conn, String graphName)
Returns the validated graph name
|
static String |
getValidatedGraphName(Connection conn, String graphName, int maxLengthAllowed)
Returns the validated graph name
|
static String |
myCheckName(String string)
Checks for any illegal characters in a SQL name.
|
static String |
qualifiedSQLName(Connection conn, String name)
Checks if the specified name is a qualified SQL name.
|
static String |
sanitizeSimpleFileName(String fileName)
do sanity checking to the filename, only allowed characters can appear in the file name
|
static String |
simpleSqlNameCheck(Connection conn, String name)
This method returns the result of SYS.DBMS_ASSERT.simple_sql_name function.
|
public static String checkSQLName(String string, int maxStringLength) throws SQLException
string - input stringmaxStringLength - maximum length for input stringSQLException - An exception is thrown if the input string contains any illegal characters or exceeds the maximum lengthpublic static boolean compareDates(Object o1, Object o2)
o1 - must be either a Date object or Stringo2 - must be either a Date object or Stringpublic static String enquoteColumnName(Connection conn, String columnName) throws SQLException
conn -columnName -SQLExceptionpublic static String enquoteLiteral(Connection conn, String name) throws SQLException
conn - the database connectionname - the input literalSQLException - A SQLexception is thrown if the dbms_assert.qualified_sql_name failedpublic static String enquoteLiteral(Connection conn, String literal, int maxLengthAllowed) throws SQLException
conn - the database connectionliteral - the input nameSQLExceptionpublic static String enquoteNameSQLName(Connection conn, String name) throws SQLException
conn - the database connectionname - the input nameSQLExceptionpublic static String enquoteTableName(Connection conn, String tableName) throws SQLException
conn -tableName -SQLExceptionpublic static int getMaxLengthAllowed()
public static String getValidatedGraphName(Connection conn, String graphName) throws SQLException
conn - the database connectiongraphName - the input graph nameSQLExceptionpublic static String getValidatedGraphName(Connection conn, String graphName, int maxLengthAllowed) throws SQLException
conn - the database connectiongraphName - the input graph nameSQLExceptionpublic static String myCheckName(String string) throws SQLException
string - input stringSQLException - An exception is thrown if the input string contains any illegal characters or exceeds the maximum lengthpublic static String qualifiedSQLName(Connection conn, String name) throws SQLException
conn - the database connectionname - the input nameSQLException - A SQLexception is thrown if the dbms_assert.qualified_sql_name failedpublic static String sanitizeSimpleFileName(String fileName) throws IllegalArgumentException
fileName -IllegalArgumentExceptionpublic static String simpleSqlNameCheck(Connection conn, String name) throws SQLException
conn - the database connectionname - the input literalSQLException - A SQLexception is thrown if the dbms_assert.simple_sql_name failedCopyright © 2016 Oracle and/or its affiliates. All Rights Reserved.