Hi all, I found a "sql_comments=" flag in Hibernate's config file. Setting it to false stopped the comments.
Regards, Nick -----Original Message----- From: Williamson, Nick Sent: 24 October 2007 15:43 To: Derby Discussion Subject: Hibernate comment in SQL Hi all, I'm using Hibernate to hook my Java app up to a Derby 10.2 database for the first time and I'm finding that something - which I *think* is Hibernate - is embedding comments in the SQL that Derby can't handle: Failed Statement is: /* criteria query */ select this_.COLOR_ID as COLOR1_162_0_, this_.COLCODE as COLCODE162_0_, this_.COLDESC as COLDESC162_0_, this_.MODIFIED as MODIFIED162_0_ from APP.COLOUR this_ ERROR 42X01: Syntax error: Encountered "/" at line 1, column 1. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(Unknown Source) at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source) at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source) at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareI nternalStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source) at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source) at org.apache.derby.impl.drda.DRDAStatement.prepareStatementJDBC3(Unknown Source) at org.apache.derby.impl.drda.DRDAStatement.prepare(Unknown Source) at org.apache.derby.impl.drda.DRDAStatement.explicitPrepare(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.parsePRPSQLSTT(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source) When I Google for that phrase "criteria query", it comes back with loads of hits relating to Hibernate, so I['m guessing that Hibernate is the guilty party. I'm specifying this in my connection URL: hibernateDialect="org.hibernate.dialect.DerbyDialect" Has anyone here hit this one before? TIA Nick
