java/jsp 连接MySQL数据库出现问题
目前在设计一个web项目——订票系统,在客户注册和查找客户信息方面都能正确处理,但是在查阅或添加票的信息方面总是行不通,出现如下错误提示:HTTPStatus500---...
目前在设计一个web项目——订票系统,在客户注册和查找客户信息方面都能正确处理,但是在查阅或添加票的信息方面总是行不通,出现如下错误提示:
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
core.sys.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:170)
root cause
java.lang.NullPointerException
org.apache.jsp.admin.jtgj.listJtgj_jsp._jspService(listJtgj_jsp.java:77)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
core.sys.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:170)
note The full stack trace of the root cause is available in the Tomcat logs.
在eclipse里边有提示:
【错误信息】executeQuery查询错误
SELECT * FROM JTGJ WHERE 1=1 AND Gjlx = '火车' limit 0,10
java.sql.SQLException: Syntax error or access violation, message from server: "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"
还可以找到:at core.db.DBSQLHandle.executeQuery(DBSQLHandle.java:78)
at ticket.jtgj.ListJtgj.select(ListJtgj.java:52)
at org.apache.jsp.admin.jtgj.listJtgj_jsp._jspService(listJtgj_jsp.java:76)
分别点开:指示
1. localRs = stat.executeQuery(sql);
2.DBReturnData datatable = dbo.executeQuery(sql.toString(), pageSize,
pageNum);
3.找不到相关的jsp源
……
弄了好久,都没弄成功,在MySQL中也找了很久,没找出什么问题,改了改数据库中的名字段的键值属性,还是不行,还有因为这是单独的一个类,又不好编译测试,好纠结啊,恳求大侠帮忙!!
谢谢各位了!!
大家仔细看看呵!谢谢了 展开
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
core.sys.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:170)
root cause
java.lang.NullPointerException
org.apache.jsp.admin.jtgj.listJtgj_jsp._jspService(listJtgj_jsp.java:77)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
core.sys.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:170)
note The full stack trace of the root cause is available in the Tomcat logs.
在eclipse里边有提示:
【错误信息】executeQuery查询错误
SELECT * FROM JTGJ WHERE 1=1 AND Gjlx = '火车' limit 0,10
java.sql.SQLException: Syntax error or access violation, message from server: "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"
还可以找到:at core.db.DBSQLHandle.executeQuery(DBSQLHandle.java:78)
at ticket.jtgj.ListJtgj.select(ListJtgj.java:52)
at org.apache.jsp.admin.jtgj.listJtgj_jsp._jspService(listJtgj_jsp.java:76)
分别点开:指示
1. localRs = stat.executeQuery(sql);
2.DBReturnData datatable = dbo.executeQuery(sql.toString(), pageSize,
pageNum);
3.找不到相关的jsp源
……
弄了好久,都没弄成功,在MySQL中也找了很久,没找出什么问题,改了改数据库中的名字段的键值属性,还是不行,还有因为这是单独的一个类,又不好编译测试,好纠结啊,恳求大侠帮忙!!
谢谢各位了!!
大家仔细看看呵!谢谢了 展开
4个回答
展开全部
SELECT * FROM JTGJ WHERE 1=1 AND Gjlx = '火车' limit 0,10
你改一个 给表JTGJ起个别名,做sql语句,有时和别名有关系
你改一个 给表JTGJ起个别名,做sql语句,有时和别名有关系
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
酱油。。。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
1,You have an error in your SQL syntax; 这表明你的sql语句有问题!
2,你尝试一下把limit 0,10 这句去掉!
因为有时候通过程序操控mysql,limit语句不太好使,跟版本也有关系!
3,再看看你的SQL语句对应的表和字段是否正确!
2,你尝试一下把limit 0,10 这句去掉!
因为有时候通过程序操控mysql,limit语句不太好使,跟版本也有关系!
3,再看看你的SQL语句对应的表和字段是否正确!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询