Logo Search packages:      
Sourcecode: mysql-connector-java version File versions

boolean com::mysql::jdbc::ResultSetMetaData::isCaseSensitive ( int  column  )  throws java.sql.SQLException [inline]

Does a column's case matter?

Parameters:
column the first column is 1, the second is 2...
Returns:
true if so
Exceptions:
java.sql.SQLException if a database access error occurs

Definition at line 78 of file ResultSetMetaData.java.

References com::mysql::jdbc::Field::getCollation(), getField(), com::mysql::jdbc::Field::getSQLType(), and com::mysql::jdbc::Field::isBinary().

                                                                            {
        Field field = getField(column);

        int sqlType = field.getSQLType();

        switch (sqlType) {
        case Types.BIT:
        case Types.TINYINT:
        case Types.SMALLINT:
        case Types.INTEGER:
        case Types.BIGINT:
        case Types.FLOAT:
        case Types.REAL:
        case Types.DOUBLE:
        case Types.DATE:
        case Types.TIME:
        case Types.TIMESTAMP:
            return false;

        case Types.CHAR:
        case Types.VARCHAR:
        case Types.LONGVARCHAR:

            if (field.isBinary()) {
                return true;
            }

            String collationName = field.getCollation();

            return ((collationName != null) && !collationName.endsWith("_ci"));

        default:
            return true;
        }
    }


Generated by  Doxygen 1.6.0   Back to index