I am new to hibernate.I am running a query using hibernate . What i want to know is , if there is a way to know what DB and schema it is connecting to ?? is there a way to do this.??
String query = "select name , id from employee";
org.Hiberanate.Session hibernateSession =/*getting session from somewhere*/;
org.Hibernate.Query queryObject = hibernateSession.createQuery(query);
List<Object[]> objects = (List<Object[]>) queryObject.list();
I looked over web and found that i can get a connection
from this Session
object and then use MetaData
of that connection to know DB . But it does not give schema name and also it just gives Oracle
as the DB name , i wanted the specific DB that it is connecting to in Oracle.