Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Fetch SQL Query(under execution) from application server (executing EJB 3 entity bean).

 
Greenhorn
Posts: 26
Netbeans IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Readers !!

I was working on Composite Keys using @IdClass annotation.
And I was not in a position to find a particular record, even though I was providing the correct values for the composite keys.

So I was wondering like, is there any way in EJB 3 to audit, log or see the sql query being sent from the application server to the database server (like in hibernate 3.x).

If yes, then please provide a sample link for it (or) even sample code will work.

Thanking You,
Akshay Sahu

 
author & internet detective
Posts: 39602
781
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Akshay,
This is going to depend on your JPA implementation. For example, open JPA has:

openjpa.Query: Messages about queries. Query strings and any parameter values, if applicable, will be logged to the TRACE level at execution time. Information about possible performance concerns will be logged to the INFO level.

 
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!