-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: problem running "build eg" using MySql
PostPosted: Wed Nov 17, 2004 2:09 am 
Newbie

Joined: Tue Nov 16, 2004 10:18 pm
Posts: 8
I'm currently exploring hibernate. I'm following the instructions to build eg
but the build terminates prematurely.

Hibernate version:
2.1.7

Name and version of the database you are using:
MySQL 4.1.7

The generated SQL (show_sql=true):

Code:
     
[java] Hibernate: select auctionite0_.id as id0_, bids1_.id as id1_, user2_
.id as id2_, auctionite0_.description as descript2_0_, auctionite0_.ends as ends
0_, auctionite0_.condition as condition0_, auctionite0_.seller as seller0_, auct
ionite0_.successfulBid as successf6_0_, bids1_.isBuyNow as isBuyNow1_, bids1_.am
ount as amount1_, bids1_.datetime as datetime1_, bids1_.bidder as bidder1_, bids
1_.item as item1_, user2_.userName as userName2_, user2_.`password` as y3_2_, us
er2_.email as email2_, user2_.firstName as firstName2_, user2_.`initial` as y6_2
_, user2_.lastName as lastName2_, bids1_.item as item__, bids1_.id as id__ from
AuctionItem auctionite0_ left outer join Bid bids1_ on auctionite0_.id=bids1_.it
em left outer join AuctionUser user2_ on bids1_.bidder=user2_.id order by  aucti
onite0_.ends desc limit ?


I tried running the sql query in MySql. It objects to the last line "desc limit ?"
Anybody encountered the same problem?

There were also some errors before like
Code:
     [java] 14:00:50,611  INFO ReflectHelper:186 - reflection optimizer disabled
for: org.hibernate.auction.Name, IllegalArgumentException: Cannot find matching
method/constructor

but the build does not terminate so I'm assuming it's ok...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 2:13 am 
Newbie

Joined: Fri Nov 12, 2004 4:33 am
Posts: 7
Location: Austin, Texas
I apologize if I'm stating the obvious here, but if you're issuing your own SQL to test this, you should replace the "?" in "desc limit ?" with an actual number, i.e., "... desc limit 10".

Hibernate does this for you, so it probably isn't what is causing your problem anyway.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 2:51 am 
Newbie

Joined: Tue Nov 16, 2004 10:18 pm
Posts: 8
hi camel...

sorry, i'm wrong and you're right... it works in TOAD when I substituted ? with a literal... it completely slipped my mind to change it... =)

below is the stack trace, immediately below the sql code log... that led me to think it has something to do with the sql...

Since this was packaged with hibernate, it should be working without a hitch. Unfortunately for me...

Code:
     
     [java] 14:36:10,269  WARN JDBCExceptionReporter:38 - SQL Error: 1064, SQLSt
ate: 42000
     [java] 14:36:10,269 ERROR JDBCExceptionReporter:46 - Syntax error or access
violation message from server: "You have an error in your SQL syntax.  Check th
e manual that corresponds to your MySQL server version for the right syntax to u
se near '?' at line 1"
     [java] 14:36:10,269  WARN JDBCExceptionReporter:38 - SQL Error: 1064, SQLSt
ate: 42000
     [java] 14:36:10,269 ERROR JDBCExceptionReporter:46 - Syntax error or access
violation message from server: "You have an error in your SQL syntax.  Check th
e manual that corresponds to your MySQL server version for the right syntax to u
se near '?' at line 1"
     [java] 14:36:10,309 ERROR JDBCExceptionReporter:38 - Could not execute quer
y
     [java] java.sql.SQLException: Syntax error or access violation message from
server: "You have an error in your SQL syntax.  Check the manual that correspon
ds to your MySQL server version for the right syntax to use near '?' at line 1"
     [java]     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2551)
     [java]     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1443)
     [java]     at com.mysql.jdbc.ServerPreparedStatement.serverPrepare(ServerPr
eparedStatement.java:1378)
     [java]     at com.mysql.jdbc.ServerPreparedStatement.<init>(ServerPreparedS
tatement.java:140)
     [java]     at com.mysql.jdbc.Connection.prepareStatement(Connection.java:12


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.