执行sql语句报错:
[@APPNAME@] DEBUG [http-8080-9] Connection.debug(27) | {conn-100218} Preparing Statement: UPDATE TB_DOCUMENT SET CLIP_ID = ? WHERE DOC_ID=?
[@APPNAME@] DEBUG [http-8080-9] PreparedStatement.debug(27) | {pstm-100219} Executing Statement: UPDATE TB_DOCUMENT SET CLIP_ID = ? WHERE DOC_ID=?
[@APPNAME@] DEBUG [http-8080-9] PreparedStatement.debug(27) | {pstm-100219} Executing Statement: UPDATE TB_DOCUMENT SET CLIP_ID = ? WHERE DOC_ID=?
[@APPNAME@] DEBUG [http-8080-9] PreparedStatement.debug(27) | {pstm-100219} Parameters: [D:/DATAMANAGER/uploadfiles/2008/10/26/666D7177696476742D3136, 568]
[@APPNAME@] DEBUG [http-8080-9] PreparedStatement.debug(27) | {pstm-100219} Parameters: [D:/DATAMANAGER/uploadfiles/2008/10/26/666D7177696476742D3136, 568]
[@APPNAME@] DEBUG [http-8080-9] PreparedStatement.debug(27) | {pstm-100219} Types: [java.lang.String, java.lang.Long]
[@APPNAME@] DEBUG [http-8080-9] PreparedStatement.debug(27) | {pstm-100219} Types: [java.lang.String, java.lang.Long]
2008-10-26 7:46:39 org.apache.catalina.core.ApplicationContext log
信息: org.springframework.dao.DataIntegrityViolationException: SqlMapClient operation; SQL [];
--- The error occurred while applying a parameter map.
--- Check the updateDocumentByPrimaryKey-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.microsoft.sqlserver.jdbc.SQLServerException: 将截断字符串或二进制数据。; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred while applying a parameter map.
--- Check the updateDocumentByPrimaryKey-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.microsoft.sqlserver.jdbc.SQLServerException: 将截断字符串或二进制数据。
我的解决方法是:把数据库该字段类型由varchar(50)改为varchar(200)
解析:该问题应该是由于字段类型设置的长度大小。