我想查找货物重量在5-10kg范围的货物运送单价。我建了一个重量价格表:
create table weighprice(
weightid int not null,  
ranUp int null,   // 重量上限
ranDn int null,   //重量下限
price float null,      //价格
primary key (weightid)); String weight = request.getParameter("weight");
 Integer weigh = Integer.parseInt(weight);
 int we = weigh.intValue();
String SqlQue="select wp.price from weighprice wp "
    +"where wp.ranDn <"+ we + "and wp.ranUp >" + we;
错误:
exception javax.servlet.ServletException: 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 'wp.ranUp >8' at line 1
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.priceSearch_jsp._jspService(priceSearch_jsp.java:128)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)