`
yefeishan
  • 浏览: 108658 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
最近访客 更多访客>>
社区版块
存档分类
最新评论

Hibernate datasource configure

阅读更多

Hibernate datasource configure ,the follow:

  1. hibernate.connection.driver_class = org.postgresql.Driver
  2. hibernate.connection.url = jdbc:postgresql://localhost/mydatabase
  3. hibernate.connection.username = myuser
  4. hibernate.connection.password = secret
  5. hibernate.c3p0.min_size=5
  6. hibernate.c3p0.max_size=20
  7. hibernate.c3p0.timeout=1800
  8. hibernate.c3p0.max_statements=50
  9. hibernate.dialect = net.sf.hibernate.dialect.PostgreSQLDialect

 

分享到:
评论

相关推荐

    Hibernate访问多个数据库

    局部SessionFactoryBean"> <property name="dataSource"> <ref local="sqlserverDS"/> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect....

    java hibernate连接池源码

    <property name="hibernate.connection.datasource">org.hibernate.connection.C3P0DataSource <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/testdb <property name="hibernate....

    hibernate同时配置多个数据库连接

    - **使用DataSource**:如果使用Java的JNDI数据源,可以将多个数据库的连接信息配置在应用服务器中,然后在Hibernate配置文件中引用这些数据源。 6. **性能优化** - **连接池管理**:为了提高性能,建议为每个...

    hibernate3.0+c3p0 重新自动连接

    config.setProperty("hibernate.connection.datasource", "org.hibernate.connection.c3p0.DriverManagerDataSource"); ServiceRegistry registry = new StandardServiceRegistryBuilder().applySettings(config....

    hibernate 完整例子

    SessionFactory sessionFactory = new Configuration().configure("hibernate.cfg.xml").buildSessionFactory(); Session session = sessionFactory.openSession(); Transaction transaction = session.begin...

    详细解释Spring与Hibernate的整合原理

    Configuration configuration = new Configuration().configure(); SessionFactory sessionFactory = configuration.buildSessionFactory(); // 从当前线程中 (ThreadLocal) 中,把 session 提取出来如果没有就使用...

    Hibernate数据源的连接

    Configuration config = new Configuration().configure(); ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings(config.getProperties()).buildServiceRegistry(); SessionFactory ...

    Jboss6.0.0 M4配置jndi和hibernate

    <property name="hibernate.connection.datasource">java:jboss/datasources/MySQLDS <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect ... </hibernate-configuration> ``` 2. **...

    Hibernate常见的20个问题

    Configuration conf = new Configuration().configure("hibernate.cfg.xml"); StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(conf.getProperties()); ...

    Hibernate的配置

    .setProperty("hibernate.connection.datasource", "java:comp/env/jdbc/test") .setProperty("hibernate.order_updates", "true"); ``` #### 1.2 与数据库的连接 配置数据库连接信息是 Hibernate 配置的关键...

    Running JPA Applications with Hibernate as a Third-Party Persistence Provider on SAP NetWeaver CE 7.1EHP1

    - 这可以通过在 Eclipse 中右键点击项目,选择 Build Path > Configure Build Path,然后在 Libraries 选项卡中添加 Hibernate 的 jar 文件来实现。 ###### 3.2.3 更改 persistence.xml 中的持久化提供者 - 打开...

    Spring集成Struts、Hibernate.pdf

    <property name="dataSource" ref="dataSource"/> <value>com.example.entity.Book</value> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect <prop key="hibernate.show_sql">...

    SSH整合中 hibernate托管给Spring得到SessionFactory

    Configuration configuration = new Configuration().configure("/WEB-INF/hibernate.cfg.xml"); SessionFactory sessionFactory = configuration.buildSessionFactory(); ``` 在这个传统的配置方式中,Hibernate的...

    eclipse反向差件

    - **异常示例**:`org.hibernate.MappingException: Could not configure overrides from file`。 - **解决方法**:这通常是由于生成的`hibernate.reveng.xml`文件格式不正确导致的。解决方法是修改该文件的头部...

    搭建SSH框架(好).docx

    选择Hibernate 3.2,同样使用User Libraries和sshlibrary库,配置Spring配置文件`applicationContext.xml`,设置SessionFactory ID,并配置数据库连接信息,如数据源(dataSource)、驱动等。 5. 集成Struts:通过`...

    java数据库第三方包和配置java数据库第三方包和配置

    SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); Session session = sessionFactory.openSession(); Transaction tx = session.beginTransaction(); User user = session....

    SSH2集成技术

    在`applicationContext.xml`中,我们需要配置`dataSource`(数据源)和`sessionFactory`(Hibernate会话工厂)。例如: ```xml <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> ...

Global site tag (gtag.js) - Google Analytics