同一个sql不定时出现### The error may involve defaultParameterMap 5C

前提:我有个接口是根据不同的账号登录后,关联自己账号下的数据。
遇到个诡异的问题,有个语句线上运行了几个月了,
今天老大突然登录了一个有大批量数据的账号,然后这个语句就开始报错,当然日志里面有报具体是哪个语句。我拿出来这个语句在mysql里面执行没问题,然后字段对着实体类一个个的瞅,然后后面干脆重新一个个复制过去。还是报这个错误。
然后和同事讨论了一会儿也没想出来哪里会还有问题
首先只有登录这个账户查询的数据量比较大才会报这个错误。其它账号一直很正常,由于这个账号用户每次只是调另外一个数据接口看数据从未直接登录上来看,所以这个报错的接口用户是不知道的,但是现在后期正规起来,万一有的客户上来看系统还报错是不行的。现在情况是只有线上报错。线下复现不出来,线上的数据库没有权限看。
语句里每个字段和实体类字段完全一致,是复制过去的,creator = #{creator,jdbcType=VARCHAR}传参都是这种方式传的,类型也都传了

        [2018-10-08 10:14:12]10.28.47.229

content: ### The error may involve defaultParameterMap
[2018-10-08 10:14:12]10.28.47.229
content: ### The error occurred while setting parameters
[2018-10-08 10:14:12]10.28.47.229
content: ### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
[2018-10-08 10:14:12]10.28.47.229
content: The last packet successfully received from the server was 5,006 milliseconds ago. The last packet sent successfully to the server was 5,005 milliseconds ago.
[2018-10-08 10:14:12]10.28.47.229
content: ; SQL []; Communications link failure

2个回答

你的参数是用map传递的? 你看下你传进去的参数是什么,错误里说与数据库链接失败Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

u012558695
wmy102125 @Param("creator") String creator 我的参数都是这样每个按顺序传入进去的
一年多之前 回复

只有一个账号登陆的时候有问题的话,可以查一下登陆的条件查询出来的是不是一个,会不会出现了多个,导致查询赋值出错

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
java Error querying database 新手求详解

### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'evaluation_additional_status' in 'field list' ### The error may involve com.leimingtech.service.module.trade.dao.mapper.OrderMapper.findOrderList-Inline ### The error occurred while setting parameters ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'evaluation_additional_status' in 'field list' ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'evaluation_additional_status' in 'field list' org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'evaluation_additional_status' in 'field list' ### The error may involve com.leimingtech.service.module.trade.dao.mapper.OrderMapper.findOrderList-Inline ### The error occurred while setting parameters ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'evaluation_additional_status' in 'field list' ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'evaluation_additional_status' in 'field list' %09at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231) ~[spring-jdbc-4.1.4.RELEASE.jar:4.1.4.RELEASE] %09at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) ~[spring-jdbc-4.1.4.RELEASE.jar:4.1.4.RELEASE] %09at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) ~[mybatis-spring-1.2.2.jar:1.2.2] %09at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371) ~[mybatis-spring-1.2.2.jar:1.2.2] %09at com.sun.proxy.$Proxy40.selectList(Unknown Source) ~[?:?] %09at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:198) ~[mybatis-spring-1.2.2

快来大神 求解答.................

HTTP Status 500 - Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: type Exception report message Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: description The server encountered an internal error that prevented it from fulfilling this request. exception org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: ### Error updating database. Cause: java.sql.SQLException: Field 'links' doesn't have a default value ### The error may involve com.doje.limiguo.news.dao.newsMapper.insertSelective-Inline ### The error occurred while setting parameters ### SQL: insert into t_news ( title, content, imgPath, types ) values ( ?, ?, ?, ? ) ### Cause: java.sql.SQLException: Field 'links' doesn't have a default value ; SQL []; Field 'links' doesn't have a default value; nested exception is java.sql.SQLException: Field 'links' doesn't have a default value org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:973) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863) javax.servlet.http.HttpServlet.service(HttpServlet.java:650) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)

The error SQL: select * from ACT_GE_PROPERTY where NAME_ = ? Cause: java.lang.NullPointerException

Caused by: org.springframework.beans.factory.BeanCreationException: Could not au towire field: private com.jeeplus.system.equips.service.lift.LiftAdminAuditServi ce com.jeeplus.system.equips.service.lift.LiftService.liftAdminAuditService; nes ted exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liftAdminAuditService': Injection of autowired dependen cies failed; nested exception is org.springframework.beans.factory.BeanCreationE xception: Could not autowire field: org.activiti.engine.TaskService com.jeeplus. system.equips.service.lift.LiftAdminAuditService.taskService; nested exception i s org.springframework.beans.factory.BeanCreationException: Error creating bean w ith name 'processEngine': FactoryBean threw exception on object creation; nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.NullPointerException ### The error may exist in org/activiti/db/mapping/entity/Property.xml ### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEn tity.selectProperty ### The error occurred while handling results ### SQL: select * from ACT_GE_PROPERTY where NAME_ = ? ### Cause: java.lang.NullPointerException 老是报这个错,怎么办哦?有人遇到过吗,求解。 对应的SQLserver表 ![图片说明](https://img-ask.csdn.net/upload/201906/18/1560824853_650090.png) 注意:其他同伴的电脑可以正常运行的

在eclpse这是什么问题,求大神解

### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'employee_job' in 'field list' ### The error may involve com.lin.dao.EmployeeDao.insertEmployee-Inline ### The error occurred while setting parameters ### SQL: INSERT INTO t_employee(employee_name,employee_code,employee_dept,employee_leader,employee_job,employee_mentor,employee_salary) VALUES(?,?,?,?,?,?,?)

SpringBoot+MyBaits+MySQL连接数据库出错,求大神指点配置

报错如下: 2017-11-19 15:13:40.009 ERROR 15152 --- [nio-8090-exec-2] e.n.y.o.service.LoginModuleService : checkUserInfo: Error message is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) ### The error may exist in file [D:\Spring\JavaWeb\OnlineBookstore\target\classes\mybatis\mapper\UserInfoMapper.xml] ### The error may involve edu.javaee.onlinebookstore.mapper.UserInfoMapper.isNameExist ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) application.properties配置如下: server.port = 8090 spring.mvc.view.prefix = /WEB-INF/jsp/ spring.mvc.view.suffix = .jsp spring.datasource.driverClassName = com.mysql.jdbc.Driver spring.datasource.url = jdbc:mysql://localhost:3306/onlinebookstore?useUnicode=true&characterEncoding=utf8&useSSL=false spring.datasource.username = root spring.datasource.password = root mybatis.typeAliasesPackage = edu.javaee.onlinebookstore.domain mybatis.config-location = classpath:mybatis/mybatis-config.xml mybatis.mapper-locations = classpath:mybatis/mapper/*Mapper.xml logging.file = log/service.log 检查过数据库密码正确,可以通过Navicat访问。

应用程序异常,访问的页面出现异常

org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: FUNCTION fhadmin.LOANPERIOD does not exist ### The error may exist in file [D:\tomcat\apache-tomcat-7.0.57\webapps\FHADMINM\WEB-INF\classes\mybatis1\interest\InterestMapper.xml] ### The error may involve InterestMapper.datalistPage-Inline ### The error occurred while setting parameters ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: FUNCTION fhadmin.LOANPERIOD does not exist ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: FUNCTION fhadmin.LOANPERIOD does not exist InteresMapper.xml如下: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="InterestMapper"> <!--表名 --> <sql id="tableName"> TB_INTERESTINTEREST </sql> <!-- 字段 --> <sql id="Field"> CLIENTNAME, PRODUCTNAME, GUARANTEEMETHOD, LOANPAYMENTAMOUNT, LOANPERIOD(MONTHS), ACCOUNTOPENINGDATE, DATEOFEXPIRY, LENDINGRATE, LENDINGRATE(MONTH), LOANBALANCE, WRITEOFFTHEPRINCIPAL, ARREARS, IRREVOCABLEINTEREST, ACCOUNTSTATUS, DATEOFCLASSIFICATION, CLASSIFICATIONRESULT, HANDLINGBANK, ATTN, INTEREST_ID </sql> <!-- 字段值 --> <sql id="FieldValue"> #{CLIENTNAME}, #{PRODUCTNAME}, #{GUARANTEEMETHOD}, #{LOANPAYMENTAMOUNT}, #{LOANPERIOD(MONTHS)}, #{ACCOUNTOPENINGDATE}, #{DATEOFEXPIRY}, #{LENDINGRATE}, #{LENDINGRATE(MONTH)}, #{LOANBALANCE}, #{WRITEOFFTHEPRINCIPAL}, #{ARREARS}, #{IRREVOCABLEINTEREST}, #{ACCOUNTSTATUS}, #{DATEOFCLASSIFICATION}, #{CLASSIFICATIONRESULT}, #{HANDLINGBANK}, #{ATTN}, #{INTEREST_ID} </sql> <!-- 新增--> <insert id="save" parameterType="pd"> insert into <include refid="tableName"></include> ( <include refid="Field"></include> ) values ( <include refid="FieldValue"></include> ) </insert> <!-- 删除--> <delete id="delete" parameterType="pd"> delete from <include refid="tableName"></include> where INTEREST_ID = #{INTEREST_ID} </delete> <!-- 修改 --> <update id="edit" parameterType="pd"> update <include refid="tableName"></include> set CLIENTNAME = #{CLIENTNAME}, PRODUCTNAME = #{PRODUCTNAME}, GUARANTEEMETHOD = #{GUARANTEEMETHOD}, LOANPAYMENTAMOUNT = #{LOANPAYMENTAMOUNT}, LOANPERIOD(MONTHS) = #{LOANPERIOD(MONTHS)}, ACCOUNTOPENINGDATE = #{ACCOUNTOPENINGDATE}, DATEOFEXPIRY = #{DATEOFEXPIRY}, LENDINGRATE = #{LENDINGRATE}, LENDINGRATE(MONTH) = #{LENDINGRATE(MONTH)}, LOANBALANCE = #{LOANBALANCE}, WRITEOFFTHEPRINCIPAL = #{WRITEOFFTHEPRINCIPAL}, ARREARS = #{ARREARS}, IRREVOCABLEINTEREST = #{IRREVOCABLEINTEREST}, ACCOUNTSTATUS = #{ACCOUNTSTATUS}, DATEOFCLASSIFICATION = #{DATEOFCLASSIFICATION}, CLASSIFICATIONRESULT = #{CLASSIFICATIONRESULT}, HANDLINGBANK = #{HANDLINGBANK}, ATTN = #{ATTN}, INTEREST_ID = INTEREST_ID where INTEREST_ID = #{INTEREST_ID} </update> <!-- 通过ID获取数据 --> <select id="findById" parameterType="pd" resultType="pd"> select <include refid="Field"></include> from <include refid="tableName"></include> where INTEREST_ID = #{INTEREST_ID} </select> <!-- 列表 --> <select id="datalistPage" parameterType="page" resultType="pd"> select <include refid="Field"></include> from <include refid="tableName"></include> where 1=1 <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 --> and ( <!-- 根据需求自己加检索条件 字段1 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') or 字段2 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') --> ) </if> </select> <!-- 列表(全部) --> <select id="listAll" parameterType="pd" resultType="pd"> select <include refid="Field"></include> from <include refid="tableName"></include> </select> <!-- 批量删除 --> <delete id="deleteAll" parameterType="String"> delete from <include refid="tableName"></include> where INTEREST_ID in <foreach item="item" index="index" collection="array" open="(" separator="," close=")"> #{item} </foreach> </delete> </mapper>

关于Mybatis中SQL语句报错的问题

提示是OrderMapper.XML中的insertSelective出错 报错信息: org.springframework.jdbc.BadSqlGrammarException: ## ## ### Error updating database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 ## ## ### The error may exist in file [E:\myProject\mall\target\classes\mapper\OrderMapper.xml] ## ### The error may involve com.example.mall.dao.OrderMapper.insertSelective-Inline ## ### The error occurred while setting parameters ## ### SQL: insert into mall_order ## ### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 ## ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1**** ## OrderMapper.XML中的代码: ``` <insert id="insertSelective" parameterType="com.example.mall.pojo.Order"> insert into mall_order <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null"> id, </if> <if test="orderNo != null"> order_no, </if> <if test="userId != null"> user_id, </if> <if test="shippingId != null"> shipping_id, </if> <if test="payment != null"> payment, </if> <if test="paymentType != null"> payment_type, </if> <if test="postage != null"> postage, </if> <if test="status != null"> status, </if> <if test="paymentTime != null"> payment_time, </if> <if test="sendTime != null"> send_time, </if> <if test="endTime != null"> end_time, </if> <if test="closeTime != null"> close_time, </if> <if test="createTime != null"> create_time, </if> <if test="updateTime != null"> update_time, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null"> #{id,jdbcType=INTEGER}, </if> <if test="orderNo != null"> #{orderNo,jdbcType=BIGINT}, </if> <if test="userId != null"> #{userId,jdbcType=INTEGER}, </if> <if test="shippingId != null"> #{shippingId,jdbcType=INTEGER}, </if> <if test="payment != null"> #{payment,jdbcType=DECIMAL}, </if> <if test="paymentType != null"> #{paymentType,jdbcType=INTEGER}, </if> <if test="postage != null"> #{postage,jdbcType=INTEGER}, </if> <if test="status != null"> #{status,jdbcType=INTEGER}, </if> <if test="paymentTime != null"> #{paymentTime,jdbcType=TIMESTAMP}, </if> <if test="sendTime != null"> #{sendTime,jdbcType=TIMESTAMP}, </if> <if test="endTime != null"> #{endTime,jdbcType=TIMESTAMP}, </if> <if test="closeTime != null"> #{closeTime,jdbcType=TIMESTAMP}, </if> <if test="createTime != null"> #{createTime,jdbcType=TIMESTAMP}, </if> <if test="updateTime != null"> #{updateTime,jdbcType=TIMESTAMP}, </if> </trim> </insert> ```

tomcat项目运行一段时间后无法连接sql server2008数据库,重启tomat又好了

具体报错: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object ### The error may exist in /com/dayainfo/ssp/sqlMapper/sqlMapper-basicDataExpertSearch.xml ### The error may involve .selectBasicDataExpertSearchByKey ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object] with root cause java.util.NoSuchElementException: Timeout waiting for idle object tomcat版本:是tomcat7 sql server版本:sql server 2008 R2 tomcat和sql server不在同一个服务器

MYBATIS 批量update 报错的问题

批量update,很简单的sql语句,可是一直在报错。不知道为什么,求助!!! <update id="updateStudentPointLevelBatch" parameterType="java.util.List"> <foreach collection="list" item="item" index="index" open="" close="" separator=";"> update student_point_level s set s.score = #{item.score} where s.id = #{item.id} </foreach> </update> 按照打印出来的sql,贴到front里运行的也都是对的.... ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update student_point_level s set s.score = 16 where s.id = 19' at line 7 ### The error may involve com.supert.st.dao.StudentPointLevelMapper.updateStudentPointLevelBatch-Inline ### The error occurred while setting parameters ### SQL: update student_point_level s set s.score = ? where s.id = ? ; update student_point_level s set s.score = ? where s.id = ? ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update student_point_level s set s.score = 16 where s.id = 19' at line 7 ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update student_point_level s set s.score = 16 where s.id = 19' at line 7

网页报错显示应用程序异常

org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''S NAME, PRODUCT CLASS NAME, GUARANTEE METHOD, LOAN AMOUNT, LOAN TE' at line 3 ### The error may exist in file [D:\tomcat\apache-tomcat-7.0.57\webapps\FHADMINM\WEB-INF\classes\mybatis1\information\InterestMapper.xml] ### The error may involve InterestMapper.datalistPage-Inline ### The error occurred while setting parameters ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''S NAME, PRODUCT CLASS NAME, GUARANTEE METHOD, LOAN AMOUNT, LOAN TE' at line 3 ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''S NAME, PRODUCT CLASS NAME, GUARANTEE METHOD, LOAN AMOUNT, LOAN TE' at line 3

Error querying database

### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'evaluation_additional_status' in 'field list' ### The error may involve com.leimingtech.service.module.trade.dao.mapper.OrderMapper.findOrderList-Inline ### The error occurred while setting parameters ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'evaluation_additional_status' in 'field list' ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'evaluation_additional_status' in 'field list' org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'evaluation_additional_status' in 'field list' ### The error may involve com.leimingtech.service.module.trade.dao.mapper.OrderMapper.findOrderList-Inline ### The error occurred while setting parameters ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'evaluation_additional_status' in 'field list' ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'evaluation_additional_status' in 'field list' %09at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231) ~[spring-jdbc-4.1.4.RELEASE.jar:4.1.4.RELEASE] %09at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) ~[spring-jdbc-4.1.4.RELEASE.jar:4.1.4.RELEASE] %09at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) ~[mybatis-spring-1.2.2.jar:1.2.2] %09at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371) ~[mybatis-spring-1.2.2.jar:1.2.2] %09at com.sun.proxy.$Proxy40.selectList(Unknown Source) ~[?:?] %09at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:198) ~[mybatis-spring-1.2.2

我这sql语句怎么一直报错?

``` insert into singer(id,name,gender,age,imgurl,type,annotation) values (#{id},#{name},#{gender},#{age},#{imgurl},#{type},#{annotation}) ``` ``` org.springframework.jdbc.BadSqlGrammarException: ### Error updating database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rank,telphone,annotation) values (33,'33',null,null,null,null)' at line 1 ### The error may exist in file [E:\java\develop\javacode\spring-boot\target\classes\mapper\Admin_userMapper.xml] ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: insert into admin_user(id,name,gender,rank,telphone,annotation) values (?,?,?,?,?,?) ### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rank,telphone,annotation) values (33,'33',null,null,null,null)' at line 1 ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rank,telphone,annotation) values (33,'33',null,null,null,null)' at line 1 ```

mybatis出现了很奇怪的问题

``` ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'card_id' in 'field list' ### The error may exist in com/ershou/mapper/UserMapper.xml ### The error may involve com.ershou.mapper.UserMapper.selectByExample-Inline ### The error occurred while setting parameters ### SQL: select card_id, password, college, grade, sex, status, trueName, image from user WHERE ( card_id = ? and password = ? ) ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'card_id' in 'field list' ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'card_id' in 'field list'] with root cause com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'card_id' in 'field list' ``` 提示我的card_id 数据库不认识,但是我的数据库就是这样定义的啊 我用的也是generator自动生成的代码 CREATE TABLE `user` ( `card_id` varchar(20) NOT NULL, `password` varchar(20) DEFAULT NULL, `college` varchar(200) DEFAULT NULL, `grade` varchar(200) DEFAULT NULL, `sex` int(2) DEFAULT '1', `status` int(2) DEFAULT '1', `trueName` varchar(20) DEFAULT NULL, `image` varchar(50) DEFAULT NULL, PRIMARY KEY (`card_id`) ) 看一下mybatis的XXXMapper.xml文件 <resultMap id="BaseResultMap" type="com.ershou.entity.User" > <id column="card_id" property="cardId" jdbcType="VARCHAR" /> <result column="password" property="password" jdbcType="VARCHAR" /> <result column="college" property="college" jdbcType="VARCHAR" /> <result column="grade" property="grade" jdbcType="VARCHAR" /> <result column="sex" property="sex" jdbcType="INTEGER" /> <result column="status" property="status" jdbcType="INTEGER" /> <result column="trueName" property="truename" jdbcType="VARCHAR" /> <result column="image" property="image" jdbcType="VARCHAR" /> </resultMap> <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.ershou.entity.UserExample" > select <if test="distinct" > distinct </if> <include refid="Base_Column_List" /> from user <if test="_parameter != null" > <include refid="Example_Where_Clause" /> </if> <if test="orderByClause != null" > order by ${orderByClause} </if> </select> 哪里出错了 见鬼了 求大神

SpringMVC的sql语句问题

![图片说明](https://img-ask.csdn.net/upload/201606/16/1466074177_318575.png) 这个插入语句有问题吗?急求 报下面这个错 ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 ### The error may involve com.tms.util.mapper.DictMapper.insertModule-Inline ### The error occurred while setting parameters ### SQL: insert into WX_DICT_MODULE values ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 ] 18:39:34.377 [http-bio-8080-exec-6] DEBUG o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Resolving exception from handler [public boolean com.tms.util.action.DictAction.saveModule(com.tms.util.bo.ModuleBo)]: org.springframework.jdbc.BadSqlGrammarException: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 ### The error may involve com.tms.util.mapper.DictMapper.insertModule-Inline ### The error occurred while setting parameters ### SQL: insert into WX_DICT_MODULE values

mybatis SQLException:关闭的连接

org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.sql.SQLException: 关闭的连接 ### The error may exist in **/**/*Mapper.xml ### The error may involve **Mapper.selectPageByExample ### The error occurred while executing a query ### SQL: 此处为查询语句 ### Cause: java.sql.SQLException: 关闭的连接 at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:77) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:69) at org.apache.ibatis.binding.MapperMethod.executeForList(MapperMethod.java:85) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:65) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:38) at $Proxy155.selectPageByExampleCache(Unknown Source)

activiti 添加bpmn文件报错

activiti 添加bpmn文件时报错:请教下各位 (关键是:有的bpmn文件可以正常添加,有的文件就会报如下错误:) 我的代码: InputStream inputStreamBpmn = this.getClass().getResourceAsStream("exclusiveGateway.bpmn"); Deployment deployment = processEngine.getRepositoryService() .createDeployment() .addInputStream("exclusiveGateway.bpmn", inputStreamBpmn) .deploy(); 下面是报错信息: org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: java.sql.SQLException: ORA-01460: 转换请求无法实施或不合理 ### The error may involve org.activiti.engine.impl.persistence.entity.ResourceEntity.insertResource-Inline ### The error occurred while setting parameters ### SQL: insert into ACT_GE_BYTEARRAY(ID_, REV_, NAME_, BYTES_, DEPLOYMENT_ID_, GENERATED_) values (?, 1, ?, ?, ?, ?) ### Cause: java.sql.SQLException: ORA-01460: 转换请求无法实施或不合理

C# 修改数据时出现:对于不返回任何基表信息的 SelectCommand 不支持动态 SQL 生成

string str = @"D:\MirServer龙纹之刃"; DataTable dt = DBItemDGV.DataSource as DataTable; if (Directory.Exists(str + @"\Mud2\DB\")) { //物品查看 string ConnectionString = @"Driver={Microsoft Paradox Driver (*.db )};DriverID=538;Fil=Paradox 5.X;DefaultDir=" + str + @"\Mud2\DB;Dbq=" + str + @"\Mud2\DB;CollatingSequence=ASCII;PWD=;"; using (System.Data.Odbc.OdbcConnection conn = new System.Data.Odbc.OdbcConnection(ConnectionString)) { conn.Open(); string sql = String.Format("update StdItems set {0}={1} where Name={2}", DBItemDGV.Columns[e.ColumnIndex].DataPropertyName, //所选单元格修改后的值 DBItemDGV.SelectedRows[0].Cells[e.ColumnIndex].Value, //所选单元格修改后的值 DBItemDGV.SelectedRows[0].Cells[1].Value); using (System.Data.Odbc.OdbcDataAdapter da = new OdbcDataAdapter(sql, conn)) { OdbcCommandBuilder b = new OdbcCommandBuilder(da); da.UpdateCommand = b.GetUpdateCommand(); da.Update(dt); } conn.Close(); } } ``` ``` select语句都是正常的,试过很多方法了,主要是自己对这块不是很理解,有没有大神? 先看看我代码有没有问题,然后再给个解决办法吧

mysql 数据库update时出错,错误代码 SQL ERROR :1213

mysql 数据库update时出错,错误代码 SQL ERROR :1213 SQLSTATE: 40001

关于mybatis的sqlxml文件中mysql分页问题

当LIMIT #{startNumber},#{showNumber}这样写时会报错。 换成LIMIT 0,10 就不会报错了。什么原因?jdbc驱动jar也换了还是报错。求解。 ``` Database product name cached for DataSource [org.apache.commons.dbcp.BasicDataSource@142bec44]: name is 'MySQL' [org.springframework.jdbc.support.SQLErrorCodesFactory] - SQL error codes for 'MySQL' found [org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator] - Translating SQLException with SQL state '42000', error code '1064', message [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1','15'' at line 4]; SQL was [] for task [ ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1','15'' at line 4 ### The error may exist in file [D:\develop\java\tomcat\webapps\adream\WEB-INF\classes\com\dream\mapping\fixedassets\CommoditySQL.xml] ### The error may involve com.dream.fixedassets.dao.CommodityDao.commodityList-Inline ### The error occurred while setting parameters ### SQL: select * from l_commodity order BY p_number LIMIT ?,? ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1','15'' at line 4 ] 六月 10, 2016 11:11:14 上午 org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [SpringMVC] in context with path [/adream] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1','15'' at line 4 ### The error may exist in file [D:\develop\java\tomcat\webapps\adream\WEB-INF\classes\com\dream\mapping\fixedassets\CommoditySQL.xml] ### The error may involve com.dream.fixedassets.dao.CommodityDao.commodityList-Inline ### The error occurred while setting parameters ### SQL: select * from l_commodity order BY p_number LIMIT ?,? ```

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

深入剖析Springboot启动原理的底层源码,再也不怕面试官问了!

大家现在应该都对Springboot很熟悉,但是你对他的启动原理了解吗?

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

你期望月薪4万,出门右拐,不送,这几个点,你也就是个初级的水平

先来看几个问题通过注解的方式注入依赖对象,介绍一下你知道的几种方式@Autowired和@Resource有何区别说一下@Autowired查找候选者的...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《Oracle Java SE编程自学与面试指南》最佳学习路线图2020年最新版(进大厂必备)

正确选择比瞎努力更重要!

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

字节跳动面试官竟然问了我JDBC?

轻松等回家通知

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

立即提问
相关内容推荐