File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Debugging SQL generated by j2ee RI?

 
Bill Pugh
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1646
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic