Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Logging each actual *real* SQL query

How would one go about retrieving each SQL query that the JPA (in this case, EclipseLink 2) layer performs on the database?

I am interested in absolutely all the SQL queries.  I tried intercepting them using postUpdate, postInsert and so on, but seeing I use parameter binding I can't get the actual native SQL query, illustrated by the the FINE logging as seen in my Glassfish log:

SELECT x,y,z FROM footable WHERE My_ID = ? LIMIT ? OFFSET ?
        bind => [274087, 15, 0]|#]

I need to find out the exact query that is run on the actual SQL server.  In the case above, I can't be certain whether 274087 is an int, or a string.  If it is a string, then I it would have to be enclosed in quotes.

So what I'm looking for is the following result:

SELECT x,y,z FROM footable WHERE My_ID = '274087' LIMIT 15 OFFSET 0

Hope someone can help... Thanks!

Back to the top