关于Hibernate数据库配置问题~! 在代码里Hibernate.initialize();可以动态的改变数据库连接地址。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 或者写两个hibernate.properties,例如连接oraA的叫做hibernateA.properties,连接oraB的叫做hibernateB.properties。 hibernateA.properties内容如下: 引用: hibernate.dialect net.sf.hibernate.dialect.OracleDialect hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver hibernate.connection.username username hibernate.connection.password password hibernate.connection.url jdbc:oracle:thin:@local:1521:oraA hibernateB.properties内容如下: 引用: hibernate.dialect net.sf.hibernate.dialect.OracleDialect hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver hibernate.connection.username usernamet hibernate.connection.password passwordt hibernate.connection.url jdbc:oracle:thin:@local:1521:oraB 程序里面: 代码: java代码: Configuration conf_oraA = new Configuration("/hibernateA.properties").addClass().......; Configuration conf_oraB = new Configuration("/hibernateB.properties").addClass().......; SessionFactory sf_oraA = conf_oraA.buildSessionFactory(); SessionFactory sf_oraB = conf_oraB.buildSessionFactory(); Session s_oraA = sf_oraA.openSession(); Session s_oraB = sf_oraB.openSession(); ...... 想提高自己代码质量 在线等!!!!急用!!! 求助这个字段为什么不能显示? 怎样用java代码实现向手机发送短信 高分悬赏! 跪求SSH框架分页每条记录多就卡的问题?? 如何利用搜索引擎进行信息采集? ajax请求遇到的问题,请大家帮忙 weblogic发布项目,页面无法显示 高薪诚聘会搭建环境、(节日1-2天) 实体bean疑问 请问那边有《精通Struts:基于MVC的Java Web设计与开发》电子版下载。。。。 200分求jdk1.4.2帮助文档!有的给我传一个!
或者写两个hibernate.properties,例如连接oraA的叫做hibernateA.properties,连接oraB的叫做hibernateB.properties。 hibernateA.properties内容如下: 引用:
hibernate.dialect net.sf.hibernate.dialect.OracleDialect
hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
hibernate.connection.username username
hibernate.connection.password password
hibernate.connection.url jdbc:oracle:thin:@local:1521:oraA hibernateB.properties内容如下: 引用:
hibernate.dialect net.sf.hibernate.dialect.OracleDialect
hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
hibernate.connection.username usernamet
hibernate.connection.password passwordt
hibernate.connection.url jdbc:oracle:thin:@local:1521:oraB
程序里面: 代码:
java代码: Configuration conf_oraA = new Configuration("/hibernateA.properties").addClass().......; Configuration conf_oraB = new Configuration("/hibernateB.properties").addClass().......; SessionFactory sf_oraA = conf_oraA.buildSessionFactory();
SessionFactory sf_oraB = conf_oraB.buildSessionFactory(); Session s_oraA = sf_oraA.openSession();
Session s_oraB = sf_oraB.openSession(); ......