Hiebernate的基本配置

 

  Hibernate的数据库连接信息是从配置文件中加载的。Hibernate的配置文件有两种形式:一种是XML格式的文件,一种是properties属性文件。properties形式的配置文件默认文件名是hibernate.properties,一个properties形式的配置文件内容如下所示:

#指定数据库使用的驱动类hibernate.connection.driver_class = com.mysql.jdbc.Driver
#指定数据库连接串hibernate.connection.url = jdbc:mysql://localhost:****/db
#指定数据库连接的用户名hibernate.connection.username = ****
#指定数据库连接的密码hibernate.connection.password = ****
#指定数据库使用的方言hibernate.dialect = net.sf.hibernate.dialect.MySQLDialect
#指定是否打印SQL语句hibernate.show_sql=true

posted on 2008-01-28 16:37  古金龙  阅读(266)  评论(0编辑  收藏  举报