| java.lang.Object org.apache.derbyTesting.functionTests.tests.lang.casting
casting | public class casting (Code) | | |
Method Summary | |
public static void | checkSupportedAssignment(int sourceType, int targetType) | public static void | checkSupportedCast(int sourceType, int targetType) | public static void | checkSupportedComparison(int sourceType, int targetType) | public static void | createTables(Connection conn) | public static void | executeQueryAndDisplay(Connection conn, String query) Display Query , execute and display results. | public static void | expectedException(SQLException sqle) | public static String | formatString(String str) | public static String | getCompatibleString(int sourceType, int targetType, int dataOffset) | public static String | getShortTypeName(int type) | public static String | getTableName(int type) | public static void | gotWrongException(SQLException sqle) We got an exception when one was expected, but it was the
wrong one. | public static boolean | isBinaryType(int typeOffset) | public static boolean | isCastException(SQLException se) | public static boolean | isCharacterType(int typeOffset) | public static boolean | isClob(int typeOffset) | public static boolean | isDateTimeTimestamp(int typeOffset) | public static boolean | isLob(int typeOffset) | public static boolean | isLongType(int typeOffset) | public static boolean | isMethodNotFoundException(SQLException se) | public static boolean | isNotComparableException(SQLException se) | public static boolean | isNotStorableException(SQLException se) | public static boolean | isSupportedAssignment(int sourceType, int targetType) | public static boolean | isSupportedCast(int sourceType, int targetType) | public static boolean | isSupportedComparison(int sourceType, int targetType) | public static void | main(String[] args) | public static void | printHTMLTables() | public static void | printShouldNotSucceedMessage(String description) | public static boolean | setValidValue(PreparedStatement ps, int param, int jdbcType) | public static void | showException(SQLException sqle) | public static boolean | sqlStateMatches(SQLException se, String expectedValue) | public static void | testAssignments(Connection conn) | public static void | testComparisons(Connection conn) | public static void | testExplicitCasts(Connection conn) | public static void | unexpectedException(SQLException sqle) |
BIGINT_OFFSET | public static int BIGINT_OFFSET(Code) | | |
BLOB_OFFSET | public static int BLOB_OFFSET(Code) | | |
CHAR_FOR_BIT_OFFSET | public static int CHAR_FOR_BIT_OFFSET(Code) | | |
CHAR_OFFSET | public static int CHAR_OFFSET(Code) | | |
CLOB_OFFSET | public static int CLOB_OFFSET(Code) | | |
DATE_OFFSET | public static int DATE_OFFSET(Code) | | |
DECIMAL_OFFSET | public static int DECIMAL_OFFSET(Code) | | |
DOUBLE_OFFSET | public static int DOUBLE_OFFSET(Code) | | |
ILLEGAL_CAST_EXCEPTION_SQLSTATE | public static String ILLEGAL_CAST_EXCEPTION_SQLSTATE(Code) | | |
INTEGER_OFFSET | public static int INTEGER_OFFSET(Code) | | |
LANG_FORMAT_EXCEPTION_SQLSTATE | public static String LANG_FORMAT_EXCEPTION_SQLSTATE(Code) | | |
LANG_NOT_COMPARABLE_SQLSTATE | public static String LANG_NOT_COMPARABLE_SQLSTATE(Code) | | |
LANG_NOT_STORABLE_SQLSTATE | public static String LANG_NOT_STORABLE_SQLSTATE(Code) | | |
LONGVARCHAR_FOR_BIT_OFFSET | public static int LONGVARCHAR_FOR_BIT_OFFSET(Code) | | |
LONGVARCHAR_OFFSET | public static int LONGVARCHAR_OFFSET(Code) | | |
METHOD_NOT_FOUND_SQLSTATE | public static String METHOD_NOT_FOUND_SQLSTATE(Code) | | |
NULL_DATA_OFFSET | public static int NULL_DATA_OFFSET(Code) | | |
REAL_OFFSET | public static int REAL_OFFSET(Code) | | |
SMALLINT_OFFSET | public static int SMALLINT_OFFSET(Code) | | |
SQLTYPE_ARRAY_SIZE | public static int SQLTYPE_ARRAY_SIZE(Code) | | |
TIMESTAMP_OFFSET | public static int TIMESTAMP_OFFSET(Code) | | |
TIME_OFFSET | public static int TIME_OFFSET(Code) | | |
T_146 | final public static boolean[][] T_146(Code) | | DB2 Table 146 - Supported explicit casts between Built-in DataTypes
This table has THE FOR BIT DATA TYPES broken out into separate columns
for clarity and testing
|
T_147a | final public static boolean[][] T_147a(Code) | | DB2 uses Table 147 to describe Data Type Compatibility for Assignments
The table 147a covers the assignments as they do differ somewhat
from comparisons which can be found in 147b
This table has DATA TYPES for operands rather than lumping types
together. Here is the mapping from DB2 Table 147 to this table.
Binary Integer = SMALLINT, INTEGER, BIGINT
Decimal Number = DECIMAL/(NUMERIC)
Floating Point = REAL, DOUBLE/(FLOAT)
Character String = CHAR, VARCHAR, LONGVARCHAR
Binary String = CHAR FOR BIT DATA, VARCHAR FOR BIT DATA, LONG VARCHAR FOR
BIT DATA
Graphic String = not suppported
Date = DATE
Time = TIME
TimeStamp = TIMESTAMP
Binary String = literal hexadecimal, CHAR FOR BIT DATA, VARCHAR FOR BIT
DATA, LONG VARCHAR FOR BIT
CLOB and BLOB are not covered in Table 147 but are included here
for clarity and testing
|
T_147b | final public static boolean[][] T_147b(Code) | | |
VALID_DATA_OFFSET | public static int VALID_DATA_OFFSET(Code) | | |
VALID_DATE_STRING | public static String VALID_DATE_STRING(Code) | | |
VALID_TIMESTAMP_STRING | public static String VALID_TIMESTAMP_STRING(Code) | | |
VALID_TIME_STRING | public static String VALID_TIME_STRING(Code) | | |
VARCHAR_FOR_BIT_OFFSET | public static int VARCHAR_FOR_BIT_OFFSET(Code) | | |
VARCHAR_OFFSET | public static int VARCHAR_OFFSET(Code) | | |
X | final public static boolean X(Code) | | |
_ | final public static boolean _(Code) | | |
isDB2 | public static boolean isDB2(Code) | | |
isDerbyNet | public static boolean isDerbyNet(Code) | | |
testNum | public static int testNum(Code) | | |
checkSupportedAssignment | public static void checkSupportedAssignment(int sourceType, int targetType)(Code) | | |
checkSupportedCast | public static void checkSupportedCast(int sourceType, int targetType)(Code) | | |
checkSupportedComparison | public static void checkSupportedComparison(int sourceType, int targetType)(Code) | | |
executeQueryAndDisplay | public static void executeQueryAndDisplay(Connection conn, String query) throws SQLException(Code) | | Display Query , execute and display results.
Parameters: conn - Connection to use Parameters: query - to execute |
expectedException | public static void expectedException(SQLException sqle)(Code) | | Show an expected exception
Parameters: sqle - SQL Exception |
getCompatibleString | public static String getCompatibleString(int sourceType, int targetType, int dataOffset)(Code) | | |
getShortTypeName | public static String getShortTypeName(int type)(Code) | | Truncates (*) from typename
Parameters: type - - Type offset |
getTableName | public static String getTableName(int type)(Code) | | Build a unique table name from the type
- table offset |
gotWrongException | public static void gotWrongException(SQLException sqle)(Code) | | We got an exception when one was expected, but it was the
wrong one. For DB2 we will just print a warning.
Parameters: sqle - |
isBinaryType | public static boolean isBinaryType(int typeOffset)(Code) | | |
isCharacterType | public static boolean isCharacterType(int typeOffset)(Code) | | |
isClob | public static boolean isClob(int typeOffset)(Code) | | |
isDateTimeTimestamp | public static boolean isDateTimeTimestamp(int typeOffset)(Code) | | |
isLob | public static boolean isLob(int typeOffset)(Code) | | |
isLongType | public static boolean isLongType(int typeOffset)(Code) | | |
isMethodNotFoundException | public static boolean isMethodNotFoundException(SQLException se)(Code) | | |
isNotComparableException | public static boolean isNotComparableException(SQLException se)(Code) | | |
isSupportedAssignment | public static boolean isSupportedAssignment(int sourceType, int targetType)(Code) | | |
isSupportedCast | public static boolean isSupportedCast(int sourceType, int targetType)(Code) | | |
isSupportedComparison | public static boolean isSupportedComparison(int sourceType, int targetType)(Code) | | |
printHTMLTables | public static void printHTMLTables()(Code) | | |
printShouldNotSucceedMessage | public static void printShouldNotSucceedMessage(String description)(Code) | | |
|
|