Multiple choice technology web technology

What is the way to pass configuration properties to Hibernate?

  1. Pass an instance of java.util.Properties to Configuration.setProperties().

  2. Place hibernate.properties in a root directory of the classpath.

  3. Set System properties using java -Dproperty=value.

  4. All the above

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

Hibernate configuration can be passed in multiple ways: programmatically via Configuration.setProperties() with a Properties object, declaratively via hibernate.properties file in the classpath root, or as JVM system properties using -D flags. All three approaches are valid.