hibernateベース(2)


Hibernateは、2つのデータベース・アクセス・ポリシーを構成できます.
1.データベース接続のためのJDBCパラメータの指定
2.JNDIによるデータベース接続の取得
JDBC接続構成

hibernate.dialect      net.sf.hiberante.dialect.MysqlDialect
hibernate.connection.driver_class      com.mysql.jdbc.Driver
hibernate.connection.url       jdbc:mysql://localhost/sample
hibernate.connection.username    root
hibernate.connection.password    mysql
 

JDBC接続構成
1.データベースアダプタ(dialect)
2.JDBC駆動クラス
3.データベース結合URL
4.データベース・ユーザー
5.データベースのパスワード
2.JNDI接続に必要な構成

hibernate.connection.datasource        jdbc/test
hibernate.connection.username          user
hibernate.connection.password          pwd
hibernate.dialect         net.sf.hibernate.dialect.MySQLDialect

JNDI接続構成
1.JNDI接続名
2.データベースのユーザー名
3.データベースのパスワード
4.データベースアダプタ(dialect)