skip to main content
Welcome to the Progress DataDirect for JDBC for MongoDB Driver : Data Types : getTypeInfo()
  

Try DataDirect Drivers Now

getTypeInfo()

The DatabaseMetaData.getTypeInfo() method returns information about data types. The following table provides getTypeInfo() results for supported MongoDB data types.
Table 5. getTypeInfo() Results
TYPE_NAME = ARRAY 1
AUTO_INCREMENT = NULL
CASE_SENSITIVE = true
CREATE_PARAMS = NULL
DATA_TYPE = -1 (LONGVARCHAR)
FIXED_PREC_SCALE = false
LITERAL_PREFIX = '
LITERAL_SUFFIX = '
LOCAL_TYPE_NAME = ARRAY
MAXIMUM_SCALE = NULL
 
MINIMUM_SCALE = 0
NULLABLE = 1 (Type allows null values)
NUM_PREC_RADIX = NULL
PRECISION = 16777204
SEARCHABLE = 0 (No support)
SQL_DATA_TYPE = NULL
SQL_DATETIME_SUB = NULL
UNSIGNED_ATTRIBUTE = NULL
TYPE_NAME = BIGINT
AUTO_INCREMENT = NULL
CASE_SENSITIVE = false
CREATE_PARAMS = NULL
DATA_TYPE = -5 (BIGINT)
FIXED_PREC_SCALE = false
LITERAL_PREFIX = NULL
LITERAL_SUFFIX = NULL
LOCAL_TYPE_NAME = BIGINT
MAXIMUM_SCALE = 0
 
MINIMUM_SCALE = 0
NULLABLE = 1 (Type allows null values)
NUM_PREC_RADIX = 10
PRECISION = 19
SEARCHABLE = 3 (Supported for all WHERE clauses)
SQL_DATA_TYPE = NULL
SQL_DATETIME_SUB = NULL
UNSIGNED_ATTRIBUTE = false
TYPE_NAME = BINDATA
AUTO_INCREMENT = NULL
CASE_SENSITIVE = false
CREATE_PARAMS = NULL
DATA_TYPE = -3 (VARBINARY)
FIXED_PREC_SCALE = false
LITERAL_PREFIX = '
LITERAL_SUFFIX = '
LOCAL_TYPE_NAME = BINDATA
MAXIMUM_SCALE = 0
 
MINIMUM_SCALE = NULL
NULLABLE = 1 (Type allows null values)
NUM_PREC_RADIX = NULL
PRECISION = 8000
SEARCHABLE = 3 (Supported for all WHERE clauses)
SQL_DATA_TYPE = NULL
SQL_DATETIME_SUB = NULL
UNSIGNED_ATTRIBUTE = NULL
TYPE_NAME = BOOLEAN
AUTO_INCREMENT = NULL
CASE_SENSITIVE = false
CREATE_PARAMS = NULL
DATA_TYPE = 16 (BOOLEAN)
FIXED_PREC_SCALE = false
LITERAL_PREFIX = NULL
LITERAL_SUFFIX = NULL
LOCAL_TYPE_NAME = BOOLEAN
MAXIMUM_SCALE = 0
 
MINIMUM_SCALE = NULL
NULLABLE = 1 (Type allows null values)
NUM_PREC_RADIX = NULL
PRECISION = 1
SEARCHABLE = 3 (Supported for all WHERE clauses)
SQL_DATA_TYPE = NULL
SQL_DATETIME_SUB = NULL
UNSIGNED_ATTRIBUTE = NULL
TYPE_NAME = DATE
AUTO_INCREMENT = NULL
CASE_SENSITIVE = false
CREATE_PARAMS = NULL
DATA_TYPE = 93 (TIMESTAMP)
FIXED_PREC_SCALE = false
LITERAL_PREFIX = '
LITERAL_SUFFIX = '
LOCAL_TYPE_NAME = DATE
MAXIMUM_SCALE = 3
 
MINIMUM_SCALE = 0
NULLABLE = 1 (Type allows null values)
NUM_PREC_RADIX = NULL
PRECISION = 23
SEARCHABLE = 3 (Supported for all WHERE clauses)
SQL_DATA_TYPE = NULL
SQL_DATETIME_SUB = NULL
UNSIGNED_ATTRIBUTE = NULL
TYPE_NAME = DECIMAL128
AUTO_INCREMENT = false
CASE_SENSITIVE = false
CREATE_PARAMS = NULL
DATA_TYPE = 3 (DECIMAL)
FIXED_PREC_SCALE = false
LITERAL_PREFIX = NULL
LITERAL_SUFFIX = NULL
LOCAL_TYPE_NAME = DECIMAL128
MAXIMUM_SCALE = 34
 
MINIMUM_SCALE = 0
NULLABLE = 1 (Type allows null values)
NUM_PREC_RADIX = 10
PRECISION = 682
SEARCHABLE = 3 (Supported for all WHERE clauses)
SQL_DATA_TYPE = NULL
SQL_DATETIME_SUB = NULL
UNSIGNED_ATTRIBUTE = false
TYPE_NAME = DOUBLE
AUTO_INCREMENT = NULL
CASE_SENSITIVE = false
CREATE_PARAMS = NULL
DATA_TYPE = 8 (DOUBLE)
FIXED_PREC_SCALE = false
LITERAL_PREFIX = NULL
LITERAL_SUFFIX = NULL
LOCAL_TYPE_NAME = DOUBLE
MAXIMUM_SCALE = 0
 
MINIMUM_SCALE = 0
NULLABLE = 1 (Type allows null values)
NUM_PREC_RADIX = 10
PRECISION = 15
SEARCHABLE = 3 (Supported for all WHERE clauses)
SQL_DATA_TYPE = NULL
SQL_DATETIME_SUB = NULL
UNSIGNED_ATTRIBUTE = false
TYPE_NAME =INTEGER
AUTO_INCREMENT = NULL
CASE_SENSITIVE = false
CREATE_PARAMS = NULL
DATA_TYPE = 4 (INTEGER)
FIXED_PREC_SCALE = false
LITERAL_PREFIX = NULL
LITERAL_SUFFIX = NULL
LOCAL_TYPE_NAME = INTEGER
MAXIMUM_SCALE = 0
 
MINIMUM_SCALE = 0
NULLABLE = 1 (Type allows null values)
NUM_PREC_RADIX = 10
PRECISION = 10
SEARCHABLE = 3 (Supported for all WHERE clauses)
SQL_DATA_TYPE = NULL
SQL_DATETIME_SUB = NULL
UNSIGNED_ATTRIBUTE = false
TYPE_NAME =OBJECT 3
AUTO_INCREMENT = NULL
CASE_SENSITIVE = true
CREATE_PARAMS = NULL
DATA_TYPE = -1 (LONGVARCHAR)
FIXED_PREC_SCALE = false
LITERAL_PREFIX = '
LITERAL_SUFFIX = '
LOCAL_TYPE_NAME = OBJECT
MAXIMUM_SCALE = 0
 
MINIMUM_SCALE = NULL
NULLABLE = 1 (Type allows null values)
NUM_PREC_RADIX = NULL
PRECISION = 16777204
SEARCHABLE = 0 (No support)
SQL_DATA_TYPE = NULL
SQL_DATETIME_SUB = NULL
UNSIGNED_ATTRIBUTE = NULL
TYPE_NAME = OBJECTID4
AUTO_INCREMENT = NULL
CASE_SENSITIVE = true
CREATE_PARAMS = NULL
DATA_TYPE = 12 (VARCHAR)
FIXED_PREC_SCALE = false
LITERAL_PREFIX = '
LITERAL_SUFFIX = '
LOCAL_TYPE_NAME = OBJECTID
MAXIMUM_SCALE = 0
 
MINIMUM_SCALE = NULL
NULLABLE = 1 (Type allows null values)
NUM_PREC_RADIX = NULL
PRECISION = 24
SEARCHABLE = 3 (Supported for all WHERE clauses)
SQL_DATA_TYPE = NULL
SQL_DATETIME_SUB = NULL
UNSIGNED_ATTRIBUTE = NULL
TYPE_NAME = STRING
AUTO_INCREMENT = NULL
CASE_SENSITIVE = true
CREATE_PARAMS = NULL
DATA_TYPE = 12 (VARCHAR) or -1 (LONGVARCHAR) 5 , 6 , 7
FIXED_PREC_SCALE = false
LITERAL_PREFIX = '
LITERAL_SUFFIX = '
LOCAL_TYPE_NAME = STRING
MAXIMUM_SCALE = 0
 
MINIMUM_SCALE = NULL
NULLABLE = 1 (Type allows null values)
NUM_PREC_RADIX = NULL
PRECISION = 8000
SEARCHABLE = 3 (Supported for all WHERE clauses)
SQL_DATA_TYPE = NULL
SQL_DATETIME_SUB = NULL
UNSIGNED_ATTRIBUTE = NULL

1 Complex data types can be returned as strings in the JSON format, or can be normalized such that nested elements are returned as columns in a relational table.

2 The driver reports a precision of 68 digits for this type; however, the native type limits the maximum number of digits before or after the decimal to 34 digits.

3 Complex data types can be returned as strings in the JSON format, or can be normalized such that nested elements are returned as columns in a new logical table.

4 The CAST_TO_NATIVE function escape may be needed to select or insert a value of the ObjectID type when MongoDB has inconsistent native types for a given field. See "Default Mapping of Columns with Inconsistent Native Data Types" and "CAST_TO_NATIVE Function Escape" for details.

5 When the driver discovers a column with a String size less than or equal to 4000 characters, String is mapped as VARCHAR and the precision is 4000 characters. When a column with a String size greater than 4000 characters is discovered, String is mapped as LONGVARCHAR and precision is 16 MB.

6 During the initial discovery and normalization process, you can use the DefaultVarcharSize configuration option to specify the default length of fields that are discovered and mapped as Varchar by the driver. If the driver discovers a field with String data of a greater length, the String data is truncated to the length of the specified value. See "DefaultVarcharSize (Configuration Option" for details.

7 You can map String to CHAR, VARCHAR, or LONGVARCHAR, regardless of the column size, using the Schema Tool. See "Creating and Customizing Schemas Using the DataDirect Schema Tool" and "Defining Columns" for details.