Class MySQL8DateTimeResultSetMetaData
java.lang.Object
com.alibaba.druid.filter.mysql8datetime.MySQL8DateTimeResultSetMetaData
- All Implemented Interfaces:
ResultSetMetaData
,Wrapper
针对mysql jdbc 8.0.23及以上版本,通过该方法控制将对象类型转换成原来的类型
- Author:
- lizongbo
- See Also:
-
Field Summary
Fields inherited from interface java.sql.ResultSetMetaData
columnNoNulls, columnNullable, columnNullableUnknown
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCatalogName
(int column) getColumnClassName
(int column) 针对8.0.24版本开始,如果把mysql DATETIME映射回Timestamp,就需要把javaClass的类型也改回去 相关类在com.mysql.cj.MysqlType 中 旧版本jdbc为 DATETIME("DATETIME", Types.TIMESTAMP, Timestamp.class, 0, MysqlType.IS_NOT_DECIMAL, 26L, "[(fsp)]"), 8.0.24及以上版本jdbc实现改为 DATETIME("DATETIME", Types.TIMESTAMP, LocalDateTime.class, 0, MysqlType.IS_NOT_DECIMAL, 26L, "[(fsp)]"),int
int
getColumnDisplaySize
(int column) getColumnLabel
(int column) getColumnName
(int column) int
getColumnType
(int column) getColumnTypeName
(int column) int
getPrecision
(int column) int
getScale
(int column) getSchemaName
(int column) getTableName
(int column) boolean
isAutoIncrement
(int column) boolean
isCaseSensitive
(int column) boolean
isCurrency
(int column) boolean
isDefinitelyWritable
(int column) int
isNullable
(int column) boolean
isReadOnly
(int column) boolean
isSearchable
(int column) boolean
isSigned
(int column) boolean
isWrapperFor
(Class<?> iface) boolean
isWritable
(int column) <T> T
-
Constructor Details
-
MySQL8DateTimeResultSetMetaData
-
-
Method Details
-
unwrap
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
getColumnCount
- Specified by:
getColumnCount
in interfaceResultSetMetaData
- Throws:
SQLException
-
isAutoIncrement
- Specified by:
isAutoIncrement
in interfaceResultSetMetaData
- Throws:
SQLException
-
isCaseSensitive
- Specified by:
isCaseSensitive
in interfaceResultSetMetaData
- Throws:
SQLException
-
isSearchable
- Specified by:
isSearchable
in interfaceResultSetMetaData
- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
isCurrency
- Specified by:
isCurrency
in interfaceResultSetMetaData
- Throws:
SQLException
-
isNullable
- Specified by:
isNullable
in interfaceResultSetMetaData
- Throws:
SQLException
-
isSigned
- Specified by:
isSigned
in interfaceResultSetMetaData
- Throws:
SQLException
-
getColumnDisplaySize
- Specified by:
getColumnDisplaySize
in interfaceResultSetMetaData
- Throws:
SQLException
-
getColumnLabel
- Specified by:
getColumnLabel
in interfaceResultSetMetaData
- Throws:
SQLException
-
getColumnName
- Specified by:
getColumnName
in interfaceResultSetMetaData
- Throws:
SQLException
-
getSchemaName
- Specified by:
getSchemaName
in interfaceResultSetMetaData
- Throws:
SQLException
-
getPrecision
- Specified by:
getPrecision
in interfaceResultSetMetaData
- Throws:
SQLException
-
getScale
- Specified by:
getScale
in interfaceResultSetMetaData
- Throws:
SQLException
-
getTableName
- Specified by:
getTableName
in interfaceResultSetMetaData
- Throws:
SQLException
-
getCatalogName
- Specified by:
getCatalogName
in interfaceResultSetMetaData
- Throws:
SQLException
-
getColumnType
- Specified by:
getColumnType
in interfaceResultSetMetaData
- Throws:
SQLException
-
getColumnTypeName
- Specified by:
getColumnTypeName
in interfaceResultSetMetaData
- Throws:
SQLException
-
isReadOnly
- Specified by:
isReadOnly
in interfaceResultSetMetaData
- Throws:
SQLException
-
isWritable
- Specified by:
isWritable
in interfaceResultSetMetaData
- Throws:
SQLException
-
isDefinitelyWritable
- Specified by:
isDefinitelyWritable
in interfaceResultSetMetaData
- Throws:
SQLException
-
getColumnClassName
针对8.0.24版本开始,如果把mysql DATETIME映射回Timestamp,就需要把javaClass的类型也改回去 相关类在com.mysql.cj.MysqlType 中 旧版本jdbc为 DATETIME("DATETIME", Types.TIMESTAMP, Timestamp.class, 0, MysqlType.IS_NOT_DECIMAL, 26L, "[(fsp)]"), 8.0.24及以上版本jdbc实现改为 DATETIME("DATETIME", Types.TIMESTAMP, LocalDateTime.class, 0, MysqlType.IS_NOT_DECIMAL, 26L, "[(fsp)]"),- Specified by:
getColumnClassName
in interfaceResultSetMetaData
- Parameters:
column
- 列的索引位- Returns:
- Throws:
SQLException
- See Also:
-