hibernate.cfg.xml配置如下
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:zy</property>
<property name="hibernate.connection.username">tom</property>
<property name="hibernate.connection.password">aaaaaa</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<mapping resource="net/huadong/exammis/pojo/Person.hbm.xml"/>
</session-factory>
</hibernate-configuration>
看网上说这样配置hibernate.hbm2ddl.auto属性以后会自动生成且更新数据库表,但是我的不能生成,也没有任何错误提示,请各位大哥帮忙分析下原因
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:zy</property>
<property name="hibernate.connection.username">tom</property>
<property name="hibernate.connection.password">aaaaaa</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<mapping resource="net/huadong/exammis/pojo/Person.hbm.xml"/>
</session-factory>
</hibernate-configuration>
看网上说这样配置hibernate.hbm2ddl.auto属性以后会自动生成且更新数据库表,但是我的不能生成,也没有任何错误提示,请各位大哥帮忙分析下原因
你数据库是用的默认的数据库吗?还是新建的数据库ZY??默认的应该是orcl把
然后,tomcat启动时会自动加载hibernate执行,要是有什么异常最好再贴出来……
但是就是表没有被创建
配置这句话,是说在数据库表已创建好以后,你又修改了映射文件
这时你在重启web服务器会自动修改表的结构
不知道楼主具体想干吗呢?就是测试这个属性的配置,还是???