我在jboss下发布了一个sar包,通过session--〉hibernate-->db调用成功。但是我还有些疑问在此请教大家:
1。hibernate2.03下是如何访问多个数据库的呢,我知道sar下有一个默认的hibernate.properties 有这样的句子
###################################
### DB2 Database
###################################
hibernate.connection.driver_class=COM.ibm.db2.jdbc.net.DB2Driver
hibernate.connection.url=jdbc:db2://lj/jive
hibernate.connection.username=db2admin
hibernate.connection.password=1
hibernate.default_schema=db2admin
hibernate.dialect=net.sf.hibernate.dialect.DB2Dialect
hibernate.show_sql=true
sessionbean掉用的时候是通过下列句子调用
javax.naming.Context ctx = new InitialContext();
SessionFactory factory = (SessionFactory) ctx.lookup("java:/hibernate/HibernateFactory");
session = factory.openSession();
我不知道她什么时候读取的hibernate.properties。
而且,我如果要在一个应用中访问多个数据库的话怎么做呢??请给出详细一点的使用步骤好么。(可别给我个连接什么的阿。我)因为我的确想进一步的了解hibernate。
线谢谢大家帮助。