Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to solve the error that parameter #2 in mybatis is set to null?
How to solve the error that parameter #2 in mybatis is set to null?
When adapting to oracle database, mybatis reported that null parameter was set incorrectly, and the bug found that there was a null value in the parameter. For Mybatis, if the parameters of jdbcType are not specified during the operation, it may cause problems.

PostgreSQL, MySQL and SQLSERVER all support JdbcType. NULL type, but Oracle does not. This problem also caused mybatis to report an error when adapting.

For example, if #{submitDate} was previously configured, it will report an error in oracle: an error occurred when setting an empty parameter.

Change it to #{submitDate, jdbcType=DATE}. Note that jdbcType is case-sensitive.