Array
This section describes the differences between Oracle Database and GaussDB when the JDBC driver of the java.sql.Array type is used.

- GaussDB currently does not support the constructors not listed in the aforementioned table.
- If the element type is a character type and the length of the construction input string exceeds that defined by the element type, Oracle Database reports an error during input parameter binding.
If the array type is the varray type and the number of elements exceeds the maximum length of varray, Oracle Database reports an error during input parameter binding.
GaussDB does not verify type modifiers when constructing or binding input parameters. When a database receives array objects and executes SQL statements, it decides whether to report an error.
Method |
Return Value Type |
Throws |
GaussDB |
---|---|---|---|
getBaseTypeName() |
String |
SQLException |
Supported. |
getBaseType() |
int |
SQLException |
Supported. |
getArray() |
Object |
SQLException |
Supported. |
getArray(java.util.Map<String,Class<?>> map) |
Object |
SQLException |
Not supported. |
getArray(long index, int count) |
Object |
SQLException |
Supported. |
getArray(long index, int count, java.util.Map<String,Class<?>> map) |
Object |
SQLException |
Not supported. |
getResultSet() |
ResultSet |
SQLException |
Not supported. |
getResultSet(java.util.Map<String,Class<?>> map) |
ResultSet |
SQLException |
Not supported. |
getResultSet(long index, int count) |
ResultSet |
SQLException |
Not supported. |
getResultSet (long index, int count, java.util.Map<String,Class<?>> map) |
ResultSet |
SQLException |
Not supported. |
free() |
void |
SQLException |
Not supported. |
Element Database Type |
Actual Return Value Type of the getArray API (Oracle Database) |
Actual Return Value Type of the getArray API (GaussDB) |
---|---|---|
CHAR |
java.lang.String[] |
java.lang.String[] |
VARCHAR/VARCHAR2 |
java.lang.String[] |
java.lang.String[] |
NCHAR |
java.lang.String[] |
java.lang.String[] |
NVARCHAR2 |
java.lang.String[] |
java.lang.String[] |
NUMBER |
java.math.BigDecimal[] |
java.math.BigDecimal[] |
NUMERIC |
java.math.BigDecimal[] |
java.math.BigDecimal[] |
DECIMAL |
java.math.BigDecimal[] |
java.math.BigDecimal[] |
INTEGER |
java.math.BigDecimal[] |
java.lang.Integer[] |
SMALLINT |
java.math.BigDecimal[] |
java.lang.Short[] |
DOUBLE PRECISION |
java.math.BigDecimal[] |
java.lang.Double[] |
FLOAT |
java.math.BigDecimal[] |
java.lang.Double[] |
REAL |
java.math.BigDecimal[] |
java.lang.Float[] |
BINARY_DOUBLE |
java.lang.Double[] |
java.lang.Double[] |
BINARY_INTEGER |
java.math.BigDecimal[] |
java.lang.Integer[] |
BOOLEAN |
java.math.BigDecimal[] |
java.lang.Boolean[] |
TIMESTAMP |
java.sql.Timestamp[] |
java.sql.Timestamp[] |
TIMESTAMP WITH TIME ZONE |
java.time.OffsetDateTime[] |
java.sql.Timestamp[] |
BLOB |
oracle.sql.BLOB[] |
java.sql.Blob[] |
CLOB |
oracle.sql.CLOB[] |
java.sql.Clob[] |
Set/Array |
java.lang.Object[] |
java.sql.Array[] |
RECORD |
java.lang.Object[] |
java.sql.Struct[] |

- GaussDB currently does not support the types unlisted in the aforementioned table.
- For details about the differences in the return values of the getArray(long index, int count) API, see the preceding table.
- The differences in index parameter of getArray(long index, int count) are as follows:
- The value range supported by Oracle Database is [1, Long.MAX_VALUE]. GaussDB supports a range of [1, Integer.MAX_VALUE].
- If the index value is greater than that of Integer.MAX_VALUE, it will be truncated in Oracle Database, while an error is reported in GaussDB.
Element Database Type |
Return Value of the getBaseType API (Oracle Database) |
Return Value of the getBaseType API (GaussDB) |
---|---|---|
CHAR |
java.sql.Types.CHAR |
java.sql.Types.CHAR |
VARCHAR/VARCHAR2 |
java.sql.Types.VARCHAR |
java.sql.Types.VARCHAR |
NCHAR |
java.sql.Types.NCHAR |
java.sql.Types.CHAR |
NVARCHAR2 |
java.sql.Types.NVARCHAR |
java.sql.Types.VARCHAR |
NUMBER |
java.sql.Types.NUMERIC |
java.sql.Types.NUMERIC |
NUMERIC |
java.sql.Types.DECIMAL |
java.sql.Types.NUMERIC |
DECIMAL |
java.sql.Types.DECIMAL |
java.sql.Types.NUMERIC |
INTEGER |
java.sql.Types.NUMERIC |
java.sql.Types.INTEGER |
SMALLINT |
java.sql.Types.NUMERIC |
java.sql.Types.SMALLINT |
DOUBLE PRECISION |
java.sql.Types.FLOAT |
java.sql.Types.DOUBLE |
FLOAT |
java.sql.Types.FLOAT |
java.sql.Types.DOUBLE |
REAL |
java.sql.Types.FLOAT |
java.sql.Types.REAL |
BINARY_DOUBLE |
oracle.jdbc.OracleTypes.BINARY_DOUBLE |
java.sql.Types.DOUBLE |
BINARY_INTEGER |
java.sql.Types.NUMERIC |
java.sql.Types.INTEGER |
BOOLEAN |
java.sql.Types.NUMERIC |
java.sql.Types.BIT |
TIMESTAMP |
java.sql.Types.TIMESTAMP |
java.sql.Types.TIMESTAMP |
TIMESTAMP WITH TIME ZONE |
oracle.jdbc.OracleTypes.TIMESTAMPTZ |
java.sql.Types.TIMESTAMP |
BLOB |
java.sql.Types.BLOB |
java.sql.Types.BLOB |
CLOB |
java.sql.Types.CLOB |
java.sql.Types.CLOB |
Set/Array |
java.sql.Types.ARRAY |
java.sql.Types.ARRAY |
RECORD |
java.sql.Types.STRUCT |
java.sql.Types.STRUCT |

GaussDB currently does not support the types unlisted in the aforementioned table.
Element Database Type |
Return Value of the getBaseTypeName API (Oracle Database) |
Return Value of the getBaseTypeName API (GaussDB) |
---|---|---|
CHAR |
"CHAR" |
"bpchar" |
VARCHAR/VARCHAR2 |
"VARCHAR" |
"varchar" |
NCHAR |
"NCHAR" |
"bpchar" |
NVARCHAR2 |
"NVARCHAR" |
"nvarchar2" |
NUMBER |
"NUMBER" |
"numeric" |
NUMERIC |
"DECIMAL" |
"numeric" |
DECIMAL |
"DECIMAL" |
"numeric" |
INTEGER |
"NUMBER" |
"int4" |
SMALLINT |
"NUMBER" |
"int2" |
DOUBLE PRECISION |
"FLOAT" |
"float8" |
FLOAT |
"FLOAT" |
"float8" |
REAL |
"FLOAT" |
"float4" |
BINARY_DOUBLE |
"BINARY_DOUBLE" |
"float8" |
BINARY_INTEGER |
"NUMBER" |
"int4" |
BOOLEAN |
"NUMBER" |
"bool" |
TIMESTAMP |
"TIMESTAMP" |
"timestamp" |
TIMESTAMP WITH TIME ZONE |
"TIMESTAMP WITH TIME ZONE" |
"timestamptz" |
BLOB |
"BLOB" |
"blob" |
CLOB |
"CLOB" |
"clob" |
Set/Array |
See the description below. |
See the description below. |
RECORD |
See the description below. |
See the description below. |

- GaussDB currently does not support the types unlisted in the aforementioned table.
- When an element is of the set, array, or RECORD type that is defined within a package, the return rules for getBaseTypeName are as follows:
- OJDBC11 returns schemaName.packageName.typeName.
- OJDBC8 generally returns schemaName.packageName.typeName, or returns "schemaName"."packageName.typeName" in the following condition:
Any of schemaName, packageName, or typeName does not meet the rule of starting with a letter followed by characters including letters, digits, or underscores.
- GaussDB generally returns schemaName.packageName.typeName, or returns "schemaName"."packageName"."typeName" in the following condition:
Any of schemaName, packageName, or typeName does not meet the rule of starting with a letter or underscore followed by characters including letters, digits, or underscores.
- When an element is of the set, array, or RECORD type that is defined in the schema (but not in the package), the return rules for getBaseTypeName are as follows:
- OJDBC11 returns schemaName.typeName.
- OJDBC8 generally returns schemaName.typeName, or returns "schemaName"."typeName" in the following condition:
Any of schemaName or typeName does not meet the rule of starting with a letter followed by characters including letters, digits, or underscores.
- GaussDB generally returns schemaName.typeName, or returns "schemaName"."typeName" in the following condition:
Any of schemaName or typeName does not meet the rule of starting with a letter or underscore followed by characters including letters, digits, or underscores.
- If no special processing is performed during element type creation, the getBaseTypeName API typically returns the type name in uppercase in Oracle Database, while returns the type name in lowercase in GaussDB.

- When an array is constructed, if the Java type of the input element does not match the target type, an implicit conversion operation is performed. For details on the Java types of input elements supported by various database element types, refer to the preceding table.
- GaussDB currently does not support the types unlisted in the aforementioned table.
- The constructor needs to provide an element array. The preceding table describes the differences between elements in the array.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot