com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: you have a error in your SQL syntax; check the manual that corresponds to your Mysql server version
foe the right syntax to use near '-30' at line 1
这是什么意思,我把数据库里面的字段名检查过了 没有写错。 请大神们指导!!!
查询语句格式错误,“-30”这个位置附近,应该是符号用错了,把查询语句放出来。
另外,你这样问问题是不行的。
SQL语句有错啊,执行的是什么语句贴出来
不要把代码贴到评论里,贴到你的问题里面去!
看你的代码:
ps=conn.prepareStatement("select ip,program,type,datetime,content from programLog where ip=? and program=? and datetime>=? and datetime<=? and type=? ORDER BY datetime DESC limit "+size+" offset "+(pageNo-1)*size);
size 和 (pageNo-1)*size 是否是负数??
这里要保证不能是负数!