fun typeToClass(type: Int): Class<*>? { val result: Class<*>? result = when (type) { Types.BIGINT -> Long::class.javaTypes.BINARY -> String::class.java Types.BIT -> Boolean::class.java Types.CHAR -> Char::class.java Types.DATE -> Date::class.java Types.DECIMAL -> Double::class.java Types.DOUBLE -> Double::class.java Types.FLOAT -> Float::class.java Types.INTEGER -> Int::class.java Types.LONGVARBINARY -> String::class.java Types.LONGVARCHAR -> String::class.java Types.NULL -> String::class.java Types.NUMERIC -> Double::class.java Types.OTHER -> String::class.java Types.REAL -> Double::class.java Types.SMALLINT -> Short::class.java Types.TIME -> Time::class.java Types.TIMESTAMP -> Timestamp::class.java Types.TINYINT -> Short::class.java Types.VARBINARY -> String::class.java Types.VARCHAR -> String::class.java else -> null } return result }
Returns the class associated with a SQL type .