Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:16 Go to next message
Doug Gschwind is currently offline Doug GschwindFriend
Messages: 18
Registered: July 2009
Junior Member
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 19:07 Go to previous message
Rolf Paulsen is currently offline Rolf PaulsenFriend
Messages: 14
Registered: June 2010
Junior Member
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 19:07 Go to previous message
Rolf Paulsen is currently offline Rolf PaulsenFriend
Messages: 14
Registered: June 2010
Junior Member
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: Thu Mar 28 15:19:27 GMT 2024

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

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

Back to the top