信息不是很明白么? 你的 SQL 语法有错啊。 把 sql 打印出来, 单独运行就知道了

解决方案 »

  1.   

    org.apache.jasper.JasperException: javax.servlet.ServletException: com.mysql.jdbc.exceptions.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 ''4' at line 1 看这里  sql语句估计有语法错误
      

  2.   

    org.apache.jasper.JasperException: javax.servlet.ServletException: com.mysql.jdbc.exceptions.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 ''4' at line 1 
    应该是少了 "'"号
      

  3.   

    恩,要不你改成这样看看
    StringBuffer strSql = new StringBuffer("select * from articles where tag=0")
    hql.append("  and reviewer1=" + Long.toString(((com.am.login)session.getAttribute    ("userlogin")).ID))
    hql.append("  or reviewer2=" + Long.toString(((com.am.login)session.getAttribute("userlogin")).ID))
      

  4.   

    语法错误,你先把语句在mysql中执行,看是否会报错
      

  5.   

    Long.toString(((com.am.login)session.getAttribute("userlogin")).ID)...
    session.getAttribute("userlogin")能得到值不?
      

  6.   

    你的sql语句语法有错误
    强烈建议你,以后写sql语句现在数据库工具里执行一下,然后在网程序里写。
      

  7.   

    You have an error in your SQL syntax你的sql语句有语法错误
      

  8.   

    String strSql=""; 
    Statement stmt=dbconn.getConnection().createStatement(); 
    strSql="select * from articles where tag=0 and ("; 
    strSql=strSql + "reviewer1='" + Long.toString(((com.am.login)session.getAttribute("userlogin")).ID) + "'"; 
    strSql=strSql + " or reviewer2='" + Long.toString(((com.am.login)session.getAttribute("userlogin")).ID) + "')"; 
    最好不要这样拼SQL,用占位符吧