db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <derby-...@db.apache.org>
Subject [jira] Created: (DERBY-1527) Factor out type checks in EmbedResultSet and EmbedPreparedStatement
Date Tue, 18 Jul 2006 09:52:15 GMT
Factor out type checks in EmbedResultSet and EmbedPreparedStatement
-------------------------------------------------------------------

                 Key: DERBY-1527
                 URL: http://issues.apache.org/jira/browse/DERBY-1527
             Project: Derby
          Issue Type: Improvement
          Components: JDBC
    Affects Versions: 10.2.0.0
            Reporter: Knut Anders Hatlen


EmbedPreparedStatement and EmbedResultSet have many occurrences of

    switch (...) {
        case Types.CHAR:
        case Types.VARCHAR:
        case Types.LONGVARCHAR:
        case Types.CLOB:
            break;
        default:
            throw dataTypeConversion(...);
    }

and

    switch (...) {
        case Types.BINARY:
        case Types.VARBINARY:
        case Types.LONGVARBINARY:
        case Types.BLOB:
            break;
        default:
            throw dataTypeConversion(...);
    }

Instead of having many copies of this code, it would be good to factor
it out into methods that can be shared. For instance, one could add
these methods to DataTypeDescriptor:

  public static boolean isAsciiStreamCompatible(int jdbcType)
  public static boolean isBinaryStreamCompatible(int jdbcType)
  public static boolean isCharacterStreamCompatible(int jdbcType)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message