日期:2014-05-18  浏览次数:20810 次

从多个表查询数据库:
如何从多个表查询数据,以下是问题,各位大虾是怎么从多个表查询数据的?


SQL语句:
rs=sql.executeQuery( "select   distinct   goods.goodsname,goods.price,dingdan.amount  
                                                            from   goods,dingdan
                                                            where   goods.goodsID=dingdan.goodsID   and     dingdan.email= ' "+email+ " '   ");        


下面是错误:
type   Exception   report

message  

description   The   server   encountered   an   internal   error   ()   that   prevented   it   from   fulfilling   this   request.

exception  

org.apache.jasper.JasperException:   Unable   to   compile   class   for   JSP

An   error   occurred   at   line:   13   in   the   jsp   file:   /11/l4.jsp
Generated   servlet   error:
D:\jakarta-tomcat-5.0.28\work\Catalina\localhost\_\org\apache\jsp\_11\l4_jsp.java:72:   unclosed   string   literal
                  rs=sql.executeQuery( "select   distinct   goods.goodsname,goods.price,dingdan.amount  
                                                          ^


An   error   occurred   at   line:   13   in   the   jsp   file:   /11/l4.jsp
Generated   servlet   error:
D:\jakarta-tomcat-5.0.28\work\Catalina\localhost\_\org\apache\jsp\_11\l4_jsp.java:74:   unclosed   character   literal
                                                            where   goods.goodsID=dingdan.goodsID   and   dingdan.email= ' "+email+ " ' ");
                                                                                                                                                                        ^


An   error   occurred   at   line:   13   in   the   jsp   file:   /11/l4.jsp
Generated   servlet   error:
D:\jakarta-tomcat-5.0.28\work\Catalina\localhost\_\org\apache\jsp\_11\l4_jsp.java:74:   ') '   expected