Hello,
I’m not entirely sure I understand the question. Are you trying to create some type of audit statement that logs connections? Or do you have a SQL statement that you would like to use in the application?
If the you are asking the latter, then you can create a named query in the domain object, and then call it in the DAO.
If you are asking the former, I would recommend looking at what atomikos can provide, which is in the [app]-generated-dao-context.xml file, or seeing what the database can do.
Kind regards,
Dave