Description
Question
From JDBC-spec:
/**
* Retrieves the designated column's SQL type.
...
* @return SQL type from java.sql.Types
...
*/
int getColumnType(int column) throws SQLException;
For columns of type charchar(max) I would then expect this to return -1 (java.sql.Types.LONGVARCHAR), but it returns 12 (java.sql.Types.VARCHAR). I debugged a little bit, and found that this is caused by this switch-case:
r = -1 before that switch-case (which is what I would want).
The comment here gives a pointer to why this is done:
// under Katmai map the max types to non max to be inline with DBMD.
I guess DBMD is DatabaseMetaData, but still don't understand why this is done this way.
I can't find any other way to derminine whether a column in a resultset is varchar or longvarchar.
Same goes for the other max-types I guess.
I reason I ask this question is that I'm trying to do .getClob when the coloumn is varchar(max), and .getString if it's a normal varchar.
Relevant Issues and Pull Requests
I couldn't find any issues related to this.
Metadata
Metadata
Assignees
Type
Projects
Status