With multi-dimensional model as the core, let the factory digital transformation and upgrading “within reach”>>>
ava.lang.Thread.run(Thread. java:745 )
Caused by: java.sql.SQLException: Fail to convert to internal representation
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError. java:113 )
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError. java:147 )
at oracle.jdbc.driver.DatabaseError.throwSqlException(Dat abaseError. java:209 )
at oracle.jdbc.driver.CharCommonAccessor.getByte(CharCommonAccessor. java:209 )
at oracle.jdbc.driver.OracleResultSetImpl.getByte(OracleResultSetImpl. java:464 )
at com.alibaba.druid.pool.DruidPooledResultSet.getByte(DruidPooledResultSet. java:129 )
at org.springframework.jdbc.support.JdbcUtils.getResultSetValue( JdbcUtils. java:154 )
at org.springframework.jdbc.core.BeanPropertyRowMapper.getColumnValue(BeanPropertyRowMapper. java:311 )
at org.springframework.jdbc.core.BeanPropertyRowMapper.mapRow(BeanPropertyRowMapper. java:249 )
at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor. java:93 )
at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor. java:60 )
at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate. java:460 )
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate. java:405 )
Look at the oracleresultsetimpl.getbyte in the exception information. This stack information describes that the data found in the database fails to be converted to the byte type
After checking the field type in the database table results and the data type defined in the entity class. Find app in entity class_ Type is defined as varchar type, and the corresponding field in the database is byte type. This causes the database to have an exception when mapping
Summary of problem handling steps:
1. Find the corresponding error field through exception information (such as getbyte in this example)
2. Check the byte type of the entity class and the type of the field in the database one by one
3. Confirm whether the conversion relationship corresponds, and adjust the database field type or entity field type
Similar Posts:
- IO exception: socket read timed out always appears in Oracle program
- Java.sql.sqlexception: an analysis of the causes of exhausted resultset
- java.sql.SQLException: Got error 28 from storage
- How to Solve Java.sql.sqlexception: ora-02289: sequence does not exist
- [Solved] mapper.xml Error: java.lang.AbstractMethodError: Method oracle/jdbc/driver/OracleResultSetImpl.getNString(Ljava/lang/String;)Ljava/lang/String; is abstract,
- [Solved] oracle.net.ns.NetException: Got minus one from a read call
- [Solved] org.springframework.dao.DataIntegrityViolationException: Error attempting to get column…
- [Solved] Springboot startup error: org.springframework.beans.factory.unsatisfieddependenceexception…
- java.sql.SQLException: Error; uncategorized SQLException; SQL state [null]; error code [0];
- [Solved] org.springframework.dao.EmptyResultDataAccessException: Incorrect result size: expected1, actual0