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
Constructors -
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)]"),intintgetColumnDisplaySize(int column) getColumnLabel(int column) getColumnName(int column) intgetColumnType(int column) getColumnTypeName(int column) intgetPrecision(int column) intgetScale(int column) getSchemaName(int column) getTableName(int column) booleanisAutoIncrement(int column) booleanisCaseSensitive(int column) booleanisCurrency(int column) booleanisDefinitelyWritable(int column) intisNullable(int column) booleanisReadOnly(int column) booleanisSearchable(int column) booleanisSigned(int column) booleanisWrapperFor(Class<?> iface) booleanisWritable(int column) <T> T
-
Constructor Details
-
MySQL8DateTimeResultSetMetaData
-
-
Method Details
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
getColumnCount
- Specified by:
getColumnCountin interfaceResultSetMetaData- Throws:
SQLException
-
isAutoIncrement
- Specified by:
isAutoIncrementin interfaceResultSetMetaData- Throws:
SQLException
-
isCaseSensitive
- Specified by:
isCaseSensitivein interfaceResultSetMetaData- Throws:
SQLException
-
isSearchable
- Specified by:
isSearchablein interfaceResultSetMetaData- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
isCurrency
- Specified by:
isCurrencyin interfaceResultSetMetaData- Throws:
SQLException
-
isNullable
- Specified by:
isNullablein interfaceResultSetMetaData- Throws:
SQLException
-
isSigned
- Specified by:
isSignedin interfaceResultSetMetaData- Throws:
SQLException
-
getColumnDisplaySize
- Specified by:
getColumnDisplaySizein interfaceResultSetMetaData- Throws:
SQLException
-
getColumnLabel
- Specified by:
getColumnLabelin interfaceResultSetMetaData- Throws:
SQLException
-
getColumnName
- Specified by:
getColumnNamein interfaceResultSetMetaData- Throws:
SQLException
-
getSchemaName
- Specified by:
getSchemaNamein interfaceResultSetMetaData- Throws:
SQLException
-
getPrecision
- Specified by:
getPrecisionin interfaceResultSetMetaData- Throws:
SQLException
-
getScale
- Specified by:
getScalein interfaceResultSetMetaData- Throws:
SQLException
-
getTableName
- Specified by:
getTableNamein interfaceResultSetMetaData- Throws:
SQLException
-
getCatalogName
- Specified by:
getCatalogNamein interfaceResultSetMetaData- Throws:
SQLException
-
getColumnType
- Specified by:
getColumnTypein interfaceResultSetMetaData- Throws:
SQLException
-
getColumnTypeName
- Specified by:
getColumnTypeNamein interfaceResultSetMetaData- Throws:
SQLException
-
isReadOnly
- Specified by:
isReadOnlyin interfaceResultSetMetaData- Throws:
SQLException
-
isWritable
- Specified by:
isWritablein interfaceResultSetMetaData- Throws:
SQLException
-
isDefinitelyWritable
- Specified by:
isDefinitelyWritablein 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:
getColumnClassNamein interfaceResultSetMetaData- Parameters:
column- 列的索引位- Returns:
- Throws:
SQLException- See Also:
-