您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> MSSQL >> mybatis insert sql server 出错

mybatis insert sql server 出错

来源:网络整理     时间:2016/5/7 0:28:16     关键词:SQL Server,mybatis

关于网友提出的“mybatis insert sql server 出错”问题疑问,本网通过在网上对“mybatis insert sql server 出错”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题:mybatis insert sql server 出错
描述:

sql servermybatissql

SRealData sRealData= new SRealData();
sRealData.setID("32232ddsdsd");
sRealData.setSHORT_ID("1");
sRealDataMapper.insertSelective(sRealData);

执行insert的时候报以下错误
DEBUG 2016-01-05 16:58:34,558 org.springframework.jdbc.datasource.DataSourceUtils: Fetching JDBC Connection from DataSource
DEBUG 2016-01-05 16:58:34,565 org.springframework.jdbc.datasource.DataSourceUtils: Returning JDBC Connection to DataSource
DEBUG 2016-01-05 16:58:34,565 org.springframework.jdbc.support.SQLErrorCodesFactory: Database product name cached for DataSource [com.alibaba.druid.pool.DruidDataSource@5553e3]: name is 'Microsoft SQL Server'
DEBUG 2016-01-05 16:58:34,567 org.springframework.jdbc.support.SQLErrorCodesFactory: SQL error codes for 'Microsoft SQL Server' found
DEBUG 2016-01-05 16:58:34,567 org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator: Unable to translate SQLException with Error code '8169', will now try the fallback translator
DEBUG 2016-01-05 16:58:34,568 org.springframework.jdbc.support.SQLStateSQLExceptionTranslator: Extracted SQL state class 'S0' from value 'S0002'
DEBUG 2016-01-05 16:58:34,569 org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver: Resolving exception from handler [com.voc.action.SrealDateAction@5eb17e]: org.springframework.jdbc.UncategorizedSQLException: 
### Error updating database.  Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to uniqueidentifier.
### The error may involve com.voc.dao.SRealDataMapper.insertSelective-Inline
### The error occurred while setting parameters
### SQL: insert into s_real_data      ( ID,                              SHORT_ID )       values ( ?,                              ? )
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to uniqueidentifier.
; uncategorized SQLException for SQL []; SQL state [S0002]; error code [8169]; Conversion failed when converting from a character string to uniqueidentifier.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to uniqueidentifier.
DEBUG 2016-01-05 16:58:34,571 org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver: Resolving exception from handler [com.voc.action.SrealDateAction@5eb17e]: org.springframework.jdbc.UncategorizedSQLException: 
### Error updating database.  Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to uniqueidentifier.
### The error may involve com.voc.dao.SRealDataMapper.insertSelective-Inline
### The error occurred while setting parameters
### SQL: insert into s_real_data      ( ID,                              SHORT_ID )       values ( ?,                              ? )
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to uniqueidentifier.
; uncategorized SQLException for SQL []; SQL state [S0002]; error code [8169]; Conversion failed when converting from a character string to uniqueidentifier.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to uniqueidentifier.
DEBUG 2016-01-05 16:58:34,571 org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver: Resolving exception from handler [com.voc.action.SrealDateAction@5eb17e]: org.springframework.jdbc.UncategorizedSQLException: 
### Error updating database.  Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to uniqueidentifier.
### The error may involve com.voc.dao.SRealDataMapper.insertSelective-Inline
### The error occurred while setting parameters
### SQL: insert into s_real_data      ( ID,                              SHORT_ID )       values ( ?,                              ? )
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to uniqueidentifier.
; uncategorized SQLException for SQL []; SQL state [S0002]; error code [8169]; Conversion failed when converting from a character string to uniqueidentifier.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to uniqueidentifier.
DEBUG 2016-01-05 16:58:34,573 org.springframework.web.servlet.FrameworkServlet: Could not complete request
org.springframework.jdbc.UncategorizedSQLException: 
### Error updating database.  Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to uniqueidentifier.
### The error may involve com.voc.dao.SRealDataMapper.insertSelective-Inline
### The error occurred while setting parameters
### SQL: insert into s_real_data      ( ID,                              SHORT_ID )       values ( ?,                              ? )
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to 


以上介绍了“mybatis insert sql server 出错”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/949049.html

相关图片

相关文章