• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Debugging SQL generated by j2ee RI?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic