这是什么cuowu,急!

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'd_name' in 'where clause'

我代码里写的都是dempName, 找不到d_name

我删了重写,他还是这个错误

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'd_name' in 'where clause'

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)

at com.mysql.jdbc.Util.getInstance(Util.java:386)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2728)

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2678)

at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1612)

at com.zrrd.web.demp.dao.DempDaoImpl.queryForList(DempDaoImpl.java:50)

at com.zrrd.web.demp.service.DempServiceImpl.queryForList(DempServiceImpl.java:23)

at com.zrrd.web.demp.servlet.DempServlet.queryForList(DempServlet.java:173)

at com.zrrd.web.demp.servlet.DempServlet.service(DempServlet.java:34)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

at java.lang.Thread.run(Thread.java:619)


慕粉3994852
浏览 2422回答 9
9回答

慕粉3994852

  这张图

yanyan1112

库表看一下

大咪

"select * from demp where dempName like '%"+name+"%'"这个sql语句明显有错误啊,是你截图过来有错还是什么问题,'%',应该这样写啊,"select * from demp where dempName like '%'+name+'%'"

大咪

把代码截图上来看看,我帮你找找看。。

慕粉3994852

我找遍了所有的代码都找不到d_name这个单词

慕粉3994852

dempName

yanrun

你数据库表中的列叫dempName还是d_name
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java