Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Programmatically obtain SQL statements emitted by EclipseLink(Programmatically obtain SQL statements emitted by EclipseLink 2.0)
Programmatically obtain SQL statements emitted by EclipseLink [message #653989] Sat, 12 February 2011 10:16 Go to next message
Eclipse UserFriend
Hello,

I am using EclipseLink 2.0 and trying to determine solutions for programmatically obtaining the SQL statements that are emitted by EclipseLink to be executed by the database. Ideally, the solution would work regardless of SQL logging level, as well as regardless if a JP QL, native query, named query, native named query, stored procedure, etc. was invoked via EclipseLink.

I found the following thread where James weighed in and described one solution :

http://www.eclipse.org/forums/index.php?t=tree&th=125713 &#page_top

I am wondering if there are alternatives (e.g. listeners, AOP) that would lend itself to a more general and once and only once solution that would allow me to obtain the SQL String emitted to the database by EclipseLink, irrespective of the means to get to that point.

Any ideas would be appreciated.

Thank you,

Doug Gschwind
Re: Programmatically obtain SQL statements emitted by EclipseLink [message #691905 is a reply to message #653989] Sat, 02 July 2011 15:07 Go to previous message
Eclipse UserFriend
Hi,
you could try a SessionEventListener, e.g. preExecuteQuery(), and get the Query from the event or session.
Regards
Rolf
(no subject) [message #691921 is a reply to message #653989] Sat, 02 July 2011 15:07 Go to previous message
Eclipse UserFriend
Hi,
you could try a SessionEventListener, e.g. preExecuteQuery(), and get the Query from the event or session.
Regards
Rolf
Previous Topic:(no subject)
Next Topic:ManyToMany mapping leads to duplicate entry error in join table, why is it?
Goto Forum:
  


Current Time: Tue Jul 22 19:00:22 EDT 2025

Powered by FUDForum. Page generated in 0.26313 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top