为了账号安全,请及时绑定邮箱和手机立即绑定

初学java,配置hibernate的问题。

初学java,配置hibernate的问题。

夜夜我最爱 2016-07-30 13:03:33
hibernate.cfg.xml文件<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-configuration PUBLIC        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><hibernate-configuration> <session-factory> <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <property name="connection.url">jdbc:oracle:thin:@localhost:1521:ZQDATA</property> <property name="connection.username">ZQ</property>         <property name="connection.password">1</property>  <property name="hibernate.show_sql">true</property>  <property name="hbm2ddl.auto">create</property> <mapping resource="/zqTwo/src/com/woders/hibernate.hbm.xml"/>   </session-factory></hibernate-configuration>错误:2016-7-30 12:59:33 org.hibernate.Version logVersionINFO: HHH000412: Hibernate Core {5.0.9.Final}2016-7-30 12:59:33 org.hibernate.cfg.Environment <clinit>INFO: HHH000206: hibernate.properties not found2016-7-30 12:59:33 org.hibernate.cfg.Environment buildBytecodeProviderINFO: HHH000021: Bytecode provider name : javassistException in thread "main" org.hibernate.internal.util.config.ConfigurationException: Could not locate cfg.xml resource [hibernate.cfg.xml] at org.hibernate.boot.cfgxml.internal.ConfigLoader.loadConfigXmlResource(ConfigLoader.java:53) at org.hibernate.boot.registry.StandardServiceRegistryBuilder.configure(StandardServiceRegistryBuilder.java:163) at org.hibernate.cfg.Configuration.configure(Configuration.java:259) at org.hibernate.cfg.Configuration.configure(Configuration.java:245) at com.woders.userTest.main(userTest.java:21)
查看完整描述

1 回答

?
呵呵呵呵加呵呵呵

TA贡献14条经验 获得超8个赞

没有读取到xml文件

查看完整回答
反对 回复 2016-07-30
  • 1 回答
  • 0 关注
  • 4403 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信