org.springframework.jdbc.UncategorizedSQLException: Error setting null parameter.

来源:互联网 发布:手机淘宝店铺海报图片 编辑:程序博客网 时间:2024/04/29 06:47


工具:STS

错误:------- 就是设置的参数为NULL了

org.springframework.jdbc.UncategorizedSQLException: Error setting null parameter.  Most JDBC drivers require that the JdbcType must be specified for all nullable parameters. Cause: java.sql.SQLException: 无效的列类型: 1111
; uncategorized SQLException for SQL []; SQL state [99999]; error code [17004]; 无效的列类型: 1111; nested exception is java.sql.SQLException: 无效的列类型: 1111


xml: //我这是动态赋值的,列字段也是不固定的

<insert id="saveValues" parameterType="String">
  <![CDATA[
          INSERT INTO ${sdeUserName}.${sdeLayerName}(objectid,#{file}) values (V_BOOKMARK_SEQ.nextVal,${upSql})
    ]]>
 </insert>


错误的DAO:   public void saveValues(String sdeUserName,String sdeLayerName,String file, String upSql);

正确的DAO:   public void saveValues(@Param("sdeUserName") String sdeUserName,    @Param("sdeLayerName") String     sdeLayerName,   @Param("file") String file,@Param("upSql") String upSql);

不加@Param关键字,xml参数就收不到数据

0 0
原创粉丝点击