aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Debugging SQL generated by j2ee RI? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Debugging SQL generated by j2ee RI?" Watch "Debugging SQL generated by j2ee RI?" New topic
Author

Debugging SQL generated by j2ee RI?

Bill Pugh
Greenhorn

Joined: Jul 10, 2003
Posts: 12
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.
Bill Pugh
Greenhorn

Joined: Jul 10, 2003
Posts: 12
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.
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Debugging SQL generated by j2ee RI?