I'm trying to use Sun's 1.3.1 j2ee RI to do some j2ee examples. I've finally gotten the basics up and working. The problem I'm having now is that when I start using a many-to-many CMR, I get an internal SQL exception, caused by the RI generating some bad SQL for cloudscape (the DB including in the RI). The error message I'm getting is javax.ejb.EJBException: nested exception is: SQL Exception: Syntax error: Encountered "<EOF>" at line 1, column 77. Does anyone know of an easy way to get it to spit out the SQL that it is having the problem with? That might help me figure out how to change things so that they work. Thanks Bill Pugh P.S. And yes, I've used the RI verification-tool.
Joined: Jul 10, 2003
Figured out my own answer. The SQL generated is stored in META-INF/sun-j2ee-ri.xml in the ear file generated by the deploytool.
Originally posted by Bill Pugh: Does anyone know of an easy way to get it to spit out the SQL that it is having the problem with? That might help me figure out how to change things so that they work.
Though you've found the solution to your problem, there is a very handy tool to do what you wanted. P6Spy is a JDBC driver wrapper that logs all SQL statements as well as result sets returned. It's quite handy and open source. I just looked and there's a new version from November and their previously commercial product IronEyeSQL (or some version of it) is now open source as well.