hibernate吧 关注:2,522贴子:3,001
  • 2回复贴,共1

求教 运行到sessionFactory=cfg.buildSessionFactory();就停止

只看楼主收藏回复

这是配置文件
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/building</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
<property name="connection.autocommit">true</property>
<property name="c3p0.min_size">5</property> <!--在连接池中可用数据库连接的最小数目-->
<property name="c3p0.max_size">30</property> <!--在连接池中所有数据库连接的最大数目-->
<property name="c3p0.timeout">1800</property> <!--设定数据库连接的超时时间-->
<property name="c3p0.max_statement">50</property> <!--可以被缓存的PreparedStatement的最大数目-->
<mapping resource="com/hibernate/entity/User.hbm.xml"/>
<mapping resource="com/hibernate/entity/Salesdepartments.hbm.xml"/>
<mapping resource="com/hibernate/entity/Premises.hbm.xml"/>
<mapping resource="com/hibernate/entity/Employees.hbm.xml"/>
<mapping resource="com/hibernate/entity/Donecustomer.hbm.xml"/>
<mapping resource="com/hibernate/entity/Customer.hbm.xml"/>
<mapping resource="com/hibernate/entity/Trading.hbm.xml"/>
</session-factory>


1楼2017-02-04 16:45回复
    二月 04, 2017 4:33:53 下午 org.hibernate.Version logVersion
    INFO: HHH000412: Hibernate Core {5.2.6.Final}
    二月 04, 2017 4:33:53 下午 org.hibernate.cfg.Environment <clinit>
    INFO: HHH000205: Loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=org.h2.Driver, hibernate.service.allow_crawling=false, hibernate.max_fetch_depth=5, hibernate.dialect=org.hibernate.dialect.H2Dialect, hibernate.format_sql=true, hibernate.generate_statistics=true, hibernate.connection.username=sa, hibernate.connection.url=jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;LOCK_TIMEOUT=10000, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.password=****, hibernate.connection.pool_size=5}
    二月 04, 2017 4:34:06 下午 org.hibernate.spatial.integration.SpatialService <init>
    INFO: HHH80000001: hibernate-spatial integration enabled : true
    二月 04, 2017 4:34:07 下午 org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
    INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
    二月 04, 2017 4:34:12 下午 org.hibernate.c3p0.internal.C3P0ConnectionProvider configure
    INFO: HHH010002: C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/building
    二月 04, 2017 4:34:12 下午 org.hibernate.c3p0.internal.C3P0ConnectionProvider configure
    INFO: HHH10001001: Connection properties: {user=root, password=****, autocommit=true}
    二月 04, 2017 4:34:12 下午 org.hibernate.c3p0.internal.C3P0ConnectionProvider configure
    INFO: HHH10001003: Autocommit mode: true
    [MLog-Init-Reporter] INFO com.mchange.v2.log.MLog - MLog clients using slf4j logging.
    [main] INFO com.mchange.v2.c3p0.C3P0Registry - Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
    二月 04, 2017 4:34:15 下午 org.hibernate.c3p0.internal.C3P0ConnectionProvider configure
    INFO: HHH10001007: JDBC isolation level: <unknown>
    [main] INFO com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@963bddca [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@33b5908e [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester,
    contextClassLoaderSource -> caller, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, identityToken -> 1hge15x9m2ai023botvxg|2f879bab, idleConnectionTestPeriod -> 0, initialPoolSize -> 5, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 1800, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 30, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@d866d5e4 [ description -> null, driverClass -> null, factoryClassLocation -> null, forceUseNamedDriverClass -> false, identityToken -> 1hge15x9m2ai023botvxg|aa21042, jdbcUrl -> jdbc:mysql://localhost:3306/building, properties -> {user=******, password=******, autocommit=true} ], preferredTestQuery -> null, privilegeSpawnedThreads -> false, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, extensions -> {}, factoryClassLocation -> null, identityToken -> 1hge15x9m2ai023botvxg|48ea2003, numHelperThreads -> 3 ]
    二月 04, 2017 4:34:16 下午 org.hibernate.dialect.Dialect <init>
    INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
    二月 04, 2017 4:34:17 下午 org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl useContextualLobCreation
    INFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
    二月 04, 2017 4:34:17 下午 org.hibernate.envers.boot.internal.EnversServiceImpl configure
    INFO: Envers integration enabled? : true


    2楼2017-02-04 16:47
    回复
      2025-12-21 18:23:37
      广告
      不感兴趣
      开通SVIP免广告
      同样遇到类似问题


      3楼2018-09-03 08:44
      回复