Abstract: Copyright Notice: This article for Bo Master original article, without Bo Master permission not reproduced.
Blog Address: http://www.cnblogs.com/caoyc/p/5595870.html
One, master profile naming rules
1. Default name:hibernate.cfg.xml
2. Default path: src root directory. is also the root of the class after compilation
Question: How do I load the master configuration file in a program?
Answer: new Configuration (). Configure ()
Of course we generally recommend using the default name and default path, which means that the name can be changed and the path can be changed.
Question: How do we load the main profile name or path after we change it?
Answer: We know that there are several overloaded methods for configure in the configuration class, and the return value is also a configuration object
Configuration Configure (): The main configuration file that loads the default name and default path
Configuration Configure (String Resource): Can load a profile at the specified location (in this project)
Configuration configure (file ConfigFile): Here you can load the local config file (on the local computer)
Configuration configure (URL URL): Can load profiles on the Internet
Hibernate master configuration file in a detailed