Skip to content

Commit

Permalink
[APIS-989] Datatype information needs to be added.
Browse files Browse the repository at this point in the history
http://jira.cubrid.org/browse/APIS-989

- Added datatype in getTypeInfo method
  • Loading branch information
hwany7seo authored and hwanyseo committed Mar 6, 2024
1 parent 2fabef2 commit 57bf64e
Showing 1 changed file with 133 additions and 9 deletions.
142 changes: 133 additions & 9 deletions src/jdbc/cubrid/jdbc/driver/CUBRIDDatabaseMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -1963,10 +1963,22 @@ public synchronized ResultSet getTypeInfo() throws SQLException {
"FLOAT",
"DOUBLE",
"VARCHAR",
"STRING",
"DATE",
"TIME",
"TIMESTAMP",
"DATETIME"
"TIMESTAMPTZ",
"TIMESTAMPLTZ",
"DATETIME",
"DATETIMETZ",
"DATETIMELTZ",
"BLOB",
"CLOB",
"ENUM",
"MULTISET",
"SET",
"LIST",
"JSON"
};
/* Data Type */
Object[] column2 = {
Expand All @@ -1986,10 +1998,22 @@ public synchronized ResultSet getTypeInfo() throws SQLException {
new Short((short) java.sql.Types.REAL),
new Short((short) java.sql.Types.DOUBLE),
new Short((short) java.sql.Types.VARCHAR),
new Short((short) java.sql.Types.VARCHAR),
new Short((short) java.sql.Types.DATE),
new Short((short) java.sql.Types.TIME),
new Short((short) java.sql.Types.TIMESTAMP),
new Short((short) java.sql.Types.TIMESTAMP)
new Short((short) java.sql.Types.TIMESTAMP_WITH_TIMEZONE),
new Short((short) java.sql.Types.TIMESTAMP_WITH_TIMEZONE),
new Short((short) java.sql.Types.TIMESTAMP),
new Short((short) java.sql.Types.TIMESTAMP_WITH_TIMEZONE),
new Short((short) java.sql.Types.TIMESTAMP_WITH_TIMEZONE),
new Short((short) java.sql.Types.BLOB),
new Short((short) java.sql.Types.CLOB),
new Short((short) java.sql.Types.VARCHAR),
new Short((short) java.sql.Types.ARRAY),
new Short((short) java.sql.Types.ARRAY),
new Short((short) java.sql.Types.ARRAY),
new Short((short) java.sql.Types.VARCHAR)
};
/* Precision */
Object[] column3 = {
Expand All @@ -2009,10 +2033,22 @@ public synchronized ResultSet getTypeInfo() throws SQLException {
new Integer(38),
new Integer(38),
new Integer(1073741823),
new Integer(1073741823),
new Integer(10),
new Integer(11),
new Integer(22),
new Integer(26)
new Integer(29),
new Integer(29),
new Integer(26),
new Integer(33),
new Integer(33),
new Integer(1073741823),
new Integer(1073741823),
new Integer(1073741823),
new Integer(1073741823),
new Integer(1073741823),
new Integer(1073741823),
new Integer(1073741823)
};
/* Literal prefix */
Object[] column4 = {
Expand All @@ -2032,20 +2068,36 @@ public synchronized ResultSet getTypeInfo() throws SQLException {
null,
null,
"'",
"'",
"DATE'",
"TIME'",
"TIMESTAMP'",
"DATETIME'"
"TIMESTAMPTZ'",
"TIMESTAMPLTZ'",
"DATETIME'",
"DATETIMETZ'",
"DATETIMELTZ'",
null,
null,
"'",
"MULTISET",
"SET",
"LIST",
"'"
};
/* Literal Suffix */
Object[] column5 = {
"'", null, null, "'", "'", "'", "'", "'", null, null, null, null, null, null, null, "'",
"'", "'", "'", "'"
"'", null, null, "'", "'", "'", "'", "'", null, null,
null, null, null, null, null, "'", "'", "'", "'", "'",
"'", "'", "'", "'", "'", null, null, "'", null, null,
null, "'"
};
/* Create Params */
Object[] column6 = {
"(8)", "(3)", null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null
"(8)", "(3)", null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
null, null
};
/* Nullable */
Object column7 = new Short((short) typeNullable);
Expand All @@ -2070,6 +2122,18 @@ public synchronized ResultSet getTypeInfo() throws SQLException {
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(false)
};
/* Searchable */
Expand All @@ -2090,6 +2154,18 @@ public synchronized ResultSet getTypeInfo() throws SQLException {
new Short((short) typePredBasic),
new Short((short) typePredBasic),
new Short((short) typeSearchable),
new Short((short) typeSearchable),
new Short((short) typePredBasic),
new Short((short) typePredBasic),
new Short((short) typePredBasic),
new Short((short) typePredBasic),
new Short((short) typePredBasic),
new Short((short) typePredBasic),
new Short((short) typePredBasic),
new Short((short) typePredBasic),
new Short((short) typePredBasic),
new Short((short) typePredBasic),
new Short((short) typePredBasic),
new Short((short) typePredBasic),
new Short((short) typePredBasic),
new Short((short) typePredBasic),
Expand All @@ -2116,6 +2192,18 @@ public synchronized ResultSet getTypeInfo() throws SQLException {
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(true),
new Boolean(true)
};
/* FIXED_PREC_SCALE */
Expand All @@ -2139,6 +2227,18 @@ public synchronized ResultSet getTypeInfo() throws SQLException {
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false),
new Boolean(false)
};
/* AUTO_INCREMENT */
Expand Down Expand Up @@ -2166,6 +2266,18 @@ public synchronized ResultSet getTypeInfo() throws SQLException {
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0)
};
/* MAXIMUM_SCALE */
Expand All @@ -2189,6 +2301,18 @@ public synchronized ResultSet getTypeInfo() throws SQLException {
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0),
new Integer(0)
};
/* SQL_DATA_TYPE */
Expand All @@ -2204,7 +2328,7 @@ public synchronized ResultSet getTypeInfo() throws SQLException {
value[15] = column16;
value[16] = column17;
value[17] = column18;
for (int i = 0; i < 18; i++) {
for (int i = 0; i < column1.length; i++) {
value[0] = column1[i];
value[1] = column2[i];
value[2] = column3[i];
Expand Down

0 comments on commit 57bf64e

Please sign in to comment.