java - How can I validate my jdbc connection whether the data base is up running without executing sql query -
i'm working spring jdbc, in case have execute query , refresh cache when data base running i'm not finding method appropriate call on connection object.
if you're using spring jdbctemplate perhaps use:
public <t> t execute(connectioncallback<t> action) throws dataaccessexception
execute jdbc data access operation, implemented callback action working on jdbc connection. allows implementing arbitrary data access operations, within spring's managed jdbc environment: is, participating in spring-managed transactions , converting jdbc sqlexceptions spring's dataaccessexception hierarchy.
the callback action can return result object, example domain object or collection of domain objects.
you execute action once connection established such simple query perhaps.
let me know if helps.
Comments
Post a Comment