db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sailorhero" <sailorh...@hotmail.com>
Subject Re: Question with "addDate" and "andDate"!
Date Fri, 01 Aug 2003 15:59:32 GMT
I understand the diffrent .
But i use the method which you said,It is also wrong.
Just like I used andDate().
I use Torque3.0.2.
Which version has fixed this error?
code:
   crit1.clear();
   crit1.addDate(BookPeer.TIME,2003,7,1,Criteria.GREATER_EQUAL);
   crit1.and(BookPeer.TIME, new GregorianCalendar(2003, 7, 1),Criteria.LESS_EQUAL);

log4j output:
DEBUG [main] util.BasePeer (createQueryString:994) - SELECT book.BOOK_ID, book.TITLE, book.ISBN,
book.TIME, book.PUBLISHER_ID, book.AUTHOR_ID FROM book WHERE (book.TIME>='20030801000000'
AND book.TIME<=java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=19,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2003,MONTH=7,WEEK_OF_YEAR=?,WEEK_OF_MONTH=?,DAY_OF_MONTH=1,DAY_OF_YEAR=?,DAY_OF_WEEK=?,DAY_OF_WEEK_IN_MONTH=?,AM_PM=?,HOUR=?,HOUR_OF_DAY=?,MINUTE=?,SECOND=?,MILLISECOND=?,ZONE_OFFSET=?,DST_OFFSET=?])
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 '[time=?,areFieldsSet=false,areAllFieldsSet=false,lenient=true,z"
 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1651)
 at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:889)
 at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:956)
 at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:928)
 at com.mysql.jdbc.Connection.execSQL(Connection.java:1871)
 at com.mysql.jdbc.Connection.execSQL(Connection.java:1805)
 at com.mysql.jdbc.Statement.executeQuery(Statement.java:1143)
 at com.workingdogs.village.QueryDataSet.<init>(Unknown Source)
 at org.apache.torque.util.BasePeer.executeQuery(BasePeer.java:1531)
 at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1360)
 at com.kazmier.om.BaseBookPeer.doSelectVillageRecords(BaseBookPeer.java:385)
 at com.kazmier.om.BaseBookPeer.doSelectVillageRecords(BaseBookPeer.java:353)
 at com.kazmier.om.BaseBookPeer.doSelect(BaseBookPeer.java:321)
 at com.kazmier.mytest.main(mytest.java:56)
rethrown as org.apache.torque.TorqueException: 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 '[time=?,areFieldsSet=false,areAllFieldsSet=false,lenient=true,z"
 at org.apache.torque.util.BasePeer.executeQuery(BasePeer.java:1541)
 at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1360)
 at com.kazmier.om.BaseBookPeer.doSelectVillageRecords(BaseBookPeer.java:385)
 at com.kazmier.om.BaseBookPeer.doSelectVillageRecords(BaseBookPeer.java:353)
 at com.kazmier.om.BaseBookPeer.doSelect(BaseBookPeer.java:321)
 at com.kazmier.mytest.main(mytest.java:56)
Caused by: 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 '[time=?,areFieldsSet=false,areAllFieldsSet=false,lenient=true,z"
 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1651)
 at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:889)
 at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:956)
 at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:928)
 at com.mysql.jdbc.Connection.execSQL(Connection.java:1871)
 at com.mysql.jdbc.Connection.execSQL(Connection.java:1805)
 at com.mysql.jdbc.Statement.executeQuery(Statement.java:1143)
 at com.workingdogs.village.QueryDataSet.<init>(Unknown Source)
 at org.apache.torque.util.BasePeer.executeQuery(BasePeer.java:1531)
 ... 5 more
rethrown as org.apache.torque.TorqueException: 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 '[time=?,areFieldsSet=false,areAllFieldsSet=false,lenient=true,z"
 at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1373)
 at com.kazmier.om.BaseBookPeer.doSelectVillageRecords(BaseBookPeer.java:385)
 at com.kazmier.om.BaseBookPeer.doSelectVillageRecords(BaseBookPeer.java:353)
 at com.kazmier.om.BaseBookPeer.doSelect(BaseBookPeer.java:321)
 at com.kazmier.mytest.main(mytest.java:56)
Caused by: org.apache.torque.TorqueException: 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 '[time=?,areFieldsSet=false,areAllFieldsSet=false,lenient=true,z"
 at org.apache.torque.util.BasePeer.executeQuery(BasePeer.java:1541)
 at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1360)
 ... 4 more
Caused by: 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 '[time=?,areFieldsSet=false,areAllFieldsSet=false,lenient=true,z"
 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1651)
 at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:889)
 at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:956)
 at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:928)
 at com.mysql.jdbc.Connection.execSQL(Connection.java:1871)
 at com.mysql.jdbc.Connection.execSQL(Connection.java:1805)
 at com.mysql.jdbc.Statement.executeQuery(Statement.java:1143)
 at com.workingdogs.village.QueryDataSet.<init>(Unknown Source)
 at org.apache.torque.util.BasePeer.executeQuery(BasePeer.java:1531)
 ... 5 more
Mime
View raw message