| java.lang.Object org.netbeans.modules.sql.framework.common.jdbc.SQLUtils
SQLUtils | public class SQLUtils (Code) | | Utility class supplying lookup and conversion methods for SQL-related tasks.
author: Sudhendra Seshachala author: Girish Patil version: $Revision$ |
Method Summary | |
public static long | convertFromIso8601(String isoDateTime) | public static String | createPreparedStatement(String rawSql, Map attrMap, List<String> paramList) Create a SQL String to be used with java.sql.PreparedStatement by substituting
symbols beginning "$" with "?". | public static String | createPreparedStatement(String rawSql, List symbols, List<String> orderedSymbols) Create a SQL String to be used with java.sql.PreparedStatement by substituting
symbols beginning "$" with "?". | public static GregorianCalendar | getCalendar(String isodate) | public static int | getResultantDataType(int dataType1, int dataType2) Gets datatype resulting from the combination of the given datatypes. | public static Map | getRuntimeInputNameValueMap(Map attribMap) | public static int | getStdJdbcType(String dataType) Gets JDBC int type, if any, corresponding to the given SQL datatype string. | public static String | getStdSqlType(int dataType) Gets SQL datatype string, if any, corresponding to the given JDBC int value. | public static List<String> | getStdSqlTypes() Gets List of Strings representing standard SQL datatypes. | public static List | getSupportedCastTypes() | public static int | getSupportedDBType(String dbName) | public static String | getSupportedDBType(int dbType) | public static Set | getSupportedDBTypes() Get List of supported database types. | public static List | getSupportedDateParts() | public static List | getSupportedFormatTypes() | public static List | getSupportedIntervalTypes() | public static List | getSupportedLiteralTypes() | public static boolean | isBinary(int jdbcType) | public static boolean | isNumeric(int jdbcType) | public static boolean | isPrecisionRequired(int jdbcType) | public static boolean | isScaleRequired(int type) | public static synchronized boolean | isStdJdbcType(int jdbcType) | public static String | makeStringOracleSafe(String value) Make a data string oracle "safe" by escaping single quote marks which are used to
start and end strings.
Parameters: value - to be made oracle String safe. | public static void | populatePreparedStatement(PreparedStatement ps, Map attrMap, List paramList) | public static void | setAttributeValue(PreparedStatement ps, int index, int jdbcType, Object valueObj) |
JDBCSQL_TYPE_UNDEFINED | final public static int JDBCSQL_TYPE_UNDEFINED(Code) | | Undefined jdbc type
|
VARCHAR_UNQUOTED | final public static int VARCHAR_UNQUOTED(Code) | | |
VARCHAR_UNQUOTED_STR | final public static String VARCHAR_UNQUOTED_STR(Code) | | |
convertFromIso8601 | public static long convertFromIso8601(String isoDateTime)(Code) | | convertFromIso8601
Parameters: isoDateTime - - ISO datetime a long value |
createPreparedStatement | public static String createPreparedStatement(String rawSql, Map attrMap, List<String> paramList)(Code) | | Create a SQL String to be used with java.sql.PreparedStatement by substituting
symbols beginning "$" with "?". Binding variable order is preserved.
Parameters: rawSql - Parameters: attrMap - map of RuntimeAttribute attribute name and RuntimeAttribute. Parameters: paramList - preparedStatement string |
createPreparedStatement | public static String createPreparedStatement(String rawSql, List symbols, List<String> orderedSymbols)(Code) | | Create a SQL String to be used with java.sql.PreparedStatement by substituting
symbols beginning "$" with "?". Binding variable order is preserved.
Parameters: rawSql - Parameters: symbols - list of Source column names and runtime input (prefixed $). Parameters: paramList - ordered list of above appearing in the statement preparedStatement string with binding parameter (?) for each occurence of the symbols. |
getCalendar | public static GregorianCalendar getCalendar(String isodate)(Code) | | returns a Gregorian Calendar of given iso date
Parameters: isodate - date in YYYY-MM-DDThh:mm:ss.sTZD format GregorianCalendar |
getResultantDataType | public static int getResultantDataType(int dataType1, int dataType2)(Code) | | Gets datatype resulting from the combination of the given datatypes. When two
expressions that have different data types are combined by an operator: The data
type of the resulting value is determined by applying the rules of data type
precedence to the data types of the input expressions.
Parameters: dataType1 - first datatype to evaluate Parameters: dataType2 - second datatype to evaluate resulting datatype |
getRuntimeInputNameValueMap | public static Map getRuntimeInputNameValueMap(Map attribMap)(Code) | | |
getStdJdbcType | public static int getStdJdbcType(String dataType) throws IllegalArgumentException(Code) | | Gets JDBC int type, if any, corresponding to the given SQL datatype string.
Parameters: dataType - SQL datatype whose equivalent JDBC int type is sought java.sql.Types value equivalent to dataType exception: IllegalArgumentException - if dataType is empty, null, or does notcorrespond to a valid value of java.sql.Types |
getStdSqlType | public static String getStdSqlType(int dataType) throws IllegalArgumentException(Code) | | Gets SQL datatype string, if any, corresponding to the given JDBC int value.
Parameters: dataType - SQL datatype whose corresopnding JDBC int type is sought SQL datatype string corresponding to dataType exception: IllegalArgumentException - if dataType does not correspond to a known SQLdatatype string |
getStdSqlTypes | public static List<String> getStdSqlTypes()(Code) | | Gets List of Strings representing standard SQL datatypes.
List of standard SQL datatypes. |
getSupportedCastTypes | public static List getSupportedCastTypes()(Code) | | |
getSupportedDBType | public static int getSupportedDBType(String dbName)(Code) | | getSupportedDBTypes
Parameters: dbName - - dbName int |
getSupportedDBType | public static String getSupportedDBType(int dbType)(Code) | | |
getSupportedDBTypes | public static Set getSupportedDBTypes()(Code) | | Get List of supported database types.
List of Strings representing supported database types |
getSupportedDateParts | public static List getSupportedDateParts()(Code) | | |
getSupportedFormatTypes | public static List getSupportedFormatTypes()(Code) | | |
getSupportedIntervalTypes | public static List getSupportedIntervalTypes()(Code) | | |
getSupportedLiteralTypes | public static List getSupportedLiteralTypes()(Code) | | getSupportedLiteralTypes
List |
isBinary | public static boolean isBinary(int jdbcType)(Code) | | |
isNumeric | public static boolean isNumeric(int jdbcType)(Code) | | |
isPrecisionRequired | public static boolean isPrecisionRequired(int jdbcType)(Code) | | |
isScaleRequired | public static boolean isScaleRequired(int type)(Code) | | |
isStdJdbcType | public static synchronized boolean isStdJdbcType(int jdbcType)(Code) | | Gets the stdJdbcType attribute of the Database class
Parameters: jdbcType - instance of Types The stdJdbcType value |
makeStringOracleSafe | public static String makeStringOracleSafe(String value)(Code) | | Make a data string oracle "safe" by escaping single quote marks which are used to
start and end strings.
Parameters: value - to be made oracle String safe. String which is Oracle safe |
|
|