Author: shawkins
Date: 2012-01-24 10:34:40 -0500 (Tue, 24 Jan 2012)
New Revision: 3817
Modified:
branches/7.7.x/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java
branches/7.7.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTypeInfo_TotalNumber.expected
branches/7.7.x/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTypeInfo.expected
Log:
TEIID-1908 adding standard type names to the jdbc type info
Modified: branches/7.7.x/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java
===================================================================
---
branches/7.7.x/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java 2012-01-23
20:36:36 UTC (rev 3816)
+++
branches/7.7.x/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java 2012-01-24
15:34:40 UTC (rev 3817)
@@ -1548,15 +1548,21 @@
records.add(Arrays.asList(createTypeInfoRow("boolean",
"{b'", "}", Boolean.TRUE, Boolean.TRUE, 0))); //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
records.add(Arrays.asList(createTypeInfoRow("byte", null, null,
Boolean.TRUE, Boolean.TRUE, 0))); //$NON-NLS-1$
+ records.add(Arrays.asList(createTypeInfoRow("tinyint", null, null,
Boolean.TRUE, Boolean.TRUE, 0))); //$NON-NLS-1$
records.add(Arrays.asList(createTypeInfoRow("long", null, null,
Boolean.FALSE, Boolean.FALSE, 10))); //$NON-NLS-1$
+ records.add(Arrays.asList(createTypeInfoRow("bigint", null, null,
Boolean.FALSE, Boolean.FALSE, 10))); //$NON-NLS-1$
records.add(Arrays.asList(createTypeInfoRow("char", "'",
"'", Boolean.TRUE, Boolean.TRUE, 0))); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
records.add(Arrays.asList(createTypeInfoRow("bigdecimal",null, null,
Boolean.FALSE, Boolean.TRUE, 10))); //$NON-NLS-1$
+ records.add(Arrays.asList(createTypeInfoRow("decimal",null, null,
Boolean.FALSE, Boolean.TRUE, 10))); //$NON-NLS-1$
records.add(Arrays.asList(createTypeInfoRow("biginteger", null, null,
Boolean.FALSE, Boolean.FALSE, 10))); //$NON-NLS-1$
records.add(Arrays.asList(createTypeInfoRow("integer", null, null,
Boolean.FALSE, Boolean.FALSE, 10))); //$NON-NLS-1$
records.add(Arrays.asList(createTypeInfoRow("short", null, null,
Boolean.FALSE, Boolean.FALSE, 10))); //$NON-NLS-1$
+ records.add(Arrays.asList(createTypeInfoRow("smallint", null, null,
Boolean.FALSE, Boolean.FALSE, 10))); //$NON-NLS-1$
records.add(Arrays.asList(createTypeInfoRow("float", null, null,
Boolean.FALSE, Boolean.FALSE, 10))); //$NON-NLS-1$
+ records.add(Arrays.asList(createTypeInfoRow("real", null, null,
Boolean.FALSE, Boolean.FALSE, 10))); //$NON-NLS-1$
records.add(Arrays.asList(createTypeInfoRow("double", null, null,
Boolean.FALSE, Boolean.FALSE, 10))); //$NON-NLS-1$
records.add(Arrays.asList(createTypeInfoRow("string",
"'", "'", Boolean.TRUE, Boolean.TRUE, 0))); //$NON-NLS-1$
//$NON-NLS-2$//$NON-NLS-3$
+ records.add(Arrays.asList(createTypeInfoRow("varchar",
"'", "'", Boolean.TRUE, Boolean.TRUE, 0))); //$NON-NLS-1$
//$NON-NLS-2$//$NON-NLS-3$
records.add(Arrays.asList(createTypeInfoRow("xml", null, null,
Boolean.TRUE, Boolean.TRUE, 0))); //$NON-NLS-1$
records.add(Arrays.asList(createTypeInfoRow("date",
"{d'", "}", Boolean.TRUE, Boolean.TRUE, 0))); //$NON-NLS-1$
//$NON-NLS-2$//$NON-NLS-3$
records.add(Arrays.asList(createTypeInfoRow("time",
"{t'", "}", Boolean.TRUE, Boolean.TRUE, 0))); //$NON-NLS-1$
//$NON-NLS-2$//$NON-NLS-3$
@@ -1595,7 +1601,8 @@
}
private Object[] createTypeInfoRow(String typeName, String prefix, String suffix,
Boolean unsigned, Boolean fixedPrecScale, int radix){
- return new Object[] {typeName, new Integer(JDBCSQLTypeInfo.getSQLType(typeName)),
ResultsMetadataDefaults.getDefaultPrecision(typeName), prefix, suffix, null, new
Short((short)DatabaseMetaData.typeNullable), Boolean.FALSE, new
Short((short)DatabaseMetaData.typeSearchable), unsigned, fixedPrecScale, Boolean.FALSE,
typeName, new Short((short)0), new Short((short)255), null, null, new Integer(radix)};
+ Class<?> clazz = DataTypeManager.getDataTypeClass(typeName);
+ return new Object[] {typeName, new
Integer(JDBCSQLTypeInfo.getSQLTypeFromRuntimeType(clazz)),
ResultsMetadataDefaults.getDefaultPrecision(clazz), prefix, suffix, null, new
Short((short)DatabaseMetaData.typeNullable), Boolean.FALSE, new
Short((short)DatabaseMetaData.typeSearchable), unsigned, fixedPrecScale, Boolean.FALSE,
typeName, new Short((short)0), new Short((short)255), null, null, new Integer(radix)};
}
/**
Modified:
branches/7.7.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTypeInfo_TotalNumber.expected
===================================================================
---
branches/7.7.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTypeInfo_TotalNumber.expected 2012-01-23
20:36:36 UTC (rev 3816)
+++
branches/7.7.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTypeInfo_TotalNumber.expected 2012-01-24
15:34:40 UTC (rev 3817)
@@ -2,15 +2,21 @@
TYPE_NAME DATA_TYPE PRECISION
LITERAL_PREFIX LITERAL_SUFFIX
CREATE_PARAMS
NULLABLE CASE_SENSITIVE SEARCHABLE UNSIGNED_ATTRIBUTE
FIXED_PREC_SCALE AUTO_INCREMENT LOCAL_TYPE_NAME
MINIMUM_SCALE MAXIMUM_SCALE SQL_DATA_TYPE SQL_DATETIME_SUB NUM_PREC_RADIX
boolean -7 1
{b' }
<null>
1 false 3 true
true false boolean
0 255 <null> <null> 0
byte -6 3
<null> <null>
<null>
1 false 3 true
true false byte
0 255 <null> <null>
0
+tinyint -6 3
<null> <null>
<null>
1 false 3 true
true false tinyint
0 255 <null> <null>
0
long -5 19
<null> <null>
<null>
1 false 3 false
false false long
0 255 <null> <null>
10
+bigint -5 19
<null> <null>
<null>
1 false 3 false
false false bigint
0 255 <null> <null>
10
char 1 1
' '
<null>
1 false 3 true
true false char
0 255 <null> <null> 0
bigdecimal 2 20
<null> <null>
<null>
1 false 3 false
true false bigdecimal
0 255 <null> <null>
10
+decimal 2 20
<null> <null>
<null>
1 false 3 false
true false decimal
0 255 <null> <null>
10
biginteger 2 19
<null> <null>
<null>
1 false 3 false
false false biginteger
0 255 <null> <null>
10
integer 4 10
<null> <null>
<null>
1 false 3 false
false false integer
0 255 <null> <null>
10
short 5 5
<null> <null>
<null>
1 false 3 false
false false short
0 255 <null> <null>
10
+smallint 5 5
<null> <null>
<null>
1 false 3 false
false false smallint
0 255 <null> <null>
10
float 7 20
<null> <null>
<null>
1 false 3 false
false false float
0 255 <null> <null>
10
+real 7 20
<null> <null>
<null>
1 false 3 false
false false real
0 255 <null> <null>
10
double 8 20
<null> <null>
<null>
1 false 3 false
false false double
0 255 <null> <null>
10
string 12 4000
' '
<null>
1 false 3 true
true false string
0 255 <null> <null> 0
+varchar 12 4000
' '
<null>
1 false 3 true
true false varchar
0 255 <null> <null> 0
xml 2009
2147483647 <null>
<null> <null>
1 false 3
true true false xml
0 255 <null>
<null> 0
date 91 10
{d' }
<null>
1 false 3 true
true false date
0 255 <null> <null> 0
time 92 8
{t' }
<null>
1 false 3 true
true false time
0 255 <null> <null> 0
@@ -18,7 +24,7 @@
object 2000
2147483647 <null>
<null> <null>
1 false 3
true true false object
0 255 <null>
<null> 0
blob 2004
2147483647 <null>
<null> <null>
1 false 3
true true false blob
0 255 <null>
<null> 0
clob 2005
2147483647 <null>
<null> <null>
1 false 3
true true false clob
0 255 <null>
<null> 0
-Row Count : 18
+Row Count : 24
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel
getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision
getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable
isReadOnly isSearchable isSigned isWritable
TYPE_NAME 12 QT_Ora9DS java.lang.String TYPE_NAME
string SYS DataTypes 4000 4000 0
false false false false 0 true
true false false
DATA_TYPE 4 QT_Ora9DS java.lang.Integer DATA_TYPE
integer SYS DataTypes 11 10 0
false false false true 1 false
true true true
Modified:
branches/7.7.x/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTypeInfo.expected
===================================================================
---
branches/7.7.x/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTypeInfo.expected 2012-01-23
20:36:36 UTC (rev 3816)
+++
branches/7.7.x/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTypeInfo.expected 2012-01-24
15:34:40 UTC (rev 3817)
@@ -2,15 +2,21 @@
TYPE_NAME DATA_TYPE PRECISION
LITERAL_PREFIX LITERAL_SUFFIX
CREATE_PARAMS
NULLABLE CASE_SENSITIVE SEARCHABLE UNSIGNED_ATTRIBUTE
FIXED_PREC_SCALE AUTO_INCREMENT LOCAL_TYPE_NAME
MINIMUM_SCALE MAXIMUM_SCALE SQL_DATA_TYPE SQL_DATETIME_SUB NUM_PREC_RADIX
boolean -7 1
{b' }
<null>
1 false 3 true
true false boolean
0 255 <null> <null> 0
byte -6 3
<null> <null>
<null>
1 false 3 true
true false byte
0 255 <null> <null>
0
+tinyint -6 3
<null> <null>
<null>
1 false 3 true
true false tinyint
0 255 <null> <null>
0
long -5 19
<null> <null>
<null>
1 false 3 false
false false long
0 255 <null> <null>
10
+bigint -5 19
<null> <null>
<null>
1 false 3 false
false false bigint
0 255 <null> <null>
10
char 1 1
' '
<null>
1 false 3 true
true false char
0 255 <null> <null> 0
bigdecimal 2 20
<null> <null>
<null>
1 false 3 false
true false bigdecimal
0 255 <null> <null>
10
+decimal 2 20
<null> <null>
<null>
1 false 3 false
true false decimal
0 255 <null> <null>
10
biginteger 2 19
<null> <null>
<null>
1 false 3 false
false false biginteger
0 255 <null> <null>
10
integer 4 10
<null> <null>
<null>
1 false 3 false
false false integer
0 255 <null> <null>
10
short 5 5
<null> <null>
<null>
1 false 3 false
false false short
0 255 <null> <null>
10
+smallint 5 5
<null> <null>
<null>
1 false 3 false
false false smallint
0 255 <null> <null>
10
float 7 20
<null> <null>
<null>
1 false 3 false
false false float
0 255 <null> <null>
10
+real 7 20
<null> <null>
<null>
1 false 3 false
false false real
0 255 <null> <null>
10
double 8 20
<null> <null>
<null>
1 false 3 false
false false double
0 255 <null> <null>
10
string 12 4000
' '
<null>
1 false 3 true
true false string
0 255 <null> <null> 0
+varchar 12 4000
' '
<null>
1 false 3 true
true false varchar
0 255 <null> <null> 0
xml 2009
2147483647 <null>
<null> <null>
1 false 3
true true false xml
0 255 <null>
<null> 0
date 91 10
{d' }
<null>
1 false 3 true
true false date
0 255 <null> <null> 0
time 92 8
{t' }
<null>
1 false 3 true
true false time
0 255 <null> <null> 0
@@ -18,7 +24,7 @@
object 2000
2147483647 <null>
<null> <null>
1 false 3
true true false object
0 255 <null>
<null> 0
blob 2004
2147483647 <null>
<null> <null>
1 false 3
true true false blob
0 255 <null>
<null> 0
clob 2005
2147483647 <null>
<null> <null>
1 false 3
true true false clob
0 255 <null>
<null> 0
-Row Count : 18
+Row Count : 24
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel
getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision
getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable
isReadOnly isSearchable isSigned isWritable
TYPE_NAME 12 PartsSupplier java.lang.String TYPE_NAME
string SYS DataTypes 4000 4000 0
false false false false 0 true
true false false
DATA_TYPE 4 PartsSupplier java.lang.Integer DATA_TYPE
integer SYS DataTypes 11 10 0
false false false true 1 false
true true true