Multiple choice technology web technology

Which statement is correct ?

  1. A Session will not obtain a JDBC Connection (or a Datasource) unless it is needed

  2. A Session will obtain a JDBC Connection (or a Datasource) on object create

  3. A Session has no relation with JDBC Connection (or a Datasource)

  4. none of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In Hibernate, a Session uses lazy initialization for obtaining JDBC connections. A connection is only fetched from the datasource when an actual database operation is needed, not when the Session object itself is created. This reduces unnecessary resource usage.