我的hibernate.cfg.xml 文件如下:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hiberation/Hiberation Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration> <session-factory>
<property name="connection.url">
jdbc:mysql://localhost:3308/test
</property>
<property name="connection.driver_class">
org.gjt.mm.mysql.Driver
</property>
<property name="connection.username">
root
</property>
<property name="connection.password">"123456"</property>
<property name="dialect">
net.sf.hibernate.dialect.MySQLDialect
</property>
<property name="show_sql">
true
</property>
<property name="hibernate.transaction.factory_class">
net.sf.hibernate.transaction.JDBCTransactionFactory
</property>
<property name="hibernate.use_outer_join">
true
</property>
<mapping resource="javax/hibernate/Tuser.hbm.xml"/>
</session-factory></hibernate-configuration>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hiberation/Hiberation Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration> <session-factory>
<property name="connection.url">
jdbc:mysql://localhost:3308/test
</property>
<property name="connection.driver_class">
org.gjt.mm.mysql.Driver
</property>
<property name="connection.username">
root
</property>
<property name="connection.password">"123456"</property>
<property name="dialect">
net.sf.hibernate.dialect.MySQLDialect
</property>
<property name="show_sql">
true
</property>
<property name="hibernate.transaction.factory_class">
net.sf.hibernate.transaction.JDBCTransactionFactory
</property>
<property name="hibernate.use_outer_join">
true
</property>
<mapping resource="javax/hibernate/Tuser.hbm.xml"/>
</session-factory></hibernate-configuration>
解决方案 »
- myeclipse--class文件夹
- 请问一个tomcat创建数据源的问题,我在web项目的meta-INF下配置了context-xml文件配置了jndi数据源
- 这段代码哪的问题?
- hibernate: table is not mapped. 急,在线等!
- Servlet.service() for servlet action threw exception
- 有关<logic:iterator>的用法问题
- 有没有办法重新编译类后,不需要重新启动jboss,?
- spring中bean内部bean的含义
- JSP学习迷茫中!!!!!!求救!!
- HTML调用APPLET问题,急急急急!!!散分!!!
- java初学者请教高手问题?
- ResultSet有什么类可以转换成XML?
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name = "javax.hibernate.Tuser"
table = "t_user">
<id
name="id"
column="id"
type="java.lang.Integer"
>
<generator class="native"/>
</id>
<property
name="name"
column="name"
type="java.lang.String"
/>
<property
name="password"
column="password"
type="java.lang.String"
/>
</class>
</hibernate-mapping>
cfg.Environment 483 ) Hibernate 2.1.8
(cfg.Environment 512 ) hibernate.properties not found
(cfg.Environment 543 ) using CGLIB reflection optimizer
(cfg.Environment 572 ) using JDK 1.4 java.sql.Timestamp handling
(cfg.Configuration 909 ) configuring from resource: /hibernate.cfg.xml
(cfg.Configuration 881 ) Configuration resource: /hibernate.cfg.xml
(cfg.Configuration 332 ) Mapping resource: javax/hibernate/Tuser.hbm.xml
(cfg.Binder 229 ) Mapping class: javax.hibernate.Tuser -> t_user
(cfg.Configuration 1067) Configured SessionFactory: null
(cfg.Configuration 641 ) processing one-to-many association mappings
(cfg.Configuration 650 ) processing one-to-one association property references
(cfg.Configuration 675 ) processing foreign key constraints
(dialect.Dialect 86 ) Using dialect: net.sf.hibernate.dialect.MySQLDialect
(cfg.SettingsFactory 70 ) Maximim outer join fetch depth: 2
(cfg.SettingsFactory 74 ) Use outer join fetching: true
(connection.DriverManagerConnectionProvider 42 ) Using Hibernate built-in connection pool (not for production use!)
(connection.DriverManagerConnectionProvider 43 ) Hibernate connection pool size: 20
(connection.DriverManagerConnectionProvider 77 ) using driver: org.gjt.mm.mysql.Driver at URL: jdbc:mysql://localhost:3308/test
(connection.DriverManagerConnectionProvider 78 ) connection properties: {user=root, password="123456"}
(transaction.TransactionFactoryFactory 31 ) Transaction strategy: net.sf.hibernate.transaction.JDBCTransactionFactory
(transaction.TransactionManagerLookupFactory 33 ) No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
(cfg.SettingsFactory 107 ) Could not obtain connection metadata