把: 改为: xxx为类名,不要.java扩展名
hibernate的配置文件hibernate.cfg.xml肯定的配置啊,一般需要配置连接数据库的基本配置,还有连接池的其他一些高级设置。hql语句是写在action层。
只要你能找到,放在哪里都可以。sessionFactory = new Configuration().configure("WEB-INF/hibernate.cfg.xml").buildSessionFactory(); hibernate实现有两种配置,xml配置与注释配置。 一、hibernate.cfg.xml jdbc:mysql://localhost:3306/web...
用xml配置时就需要每建一个表就hibernate-cfg-xml里加入它的映射。如果不用加入此代码就实现映射就要用注解的方式,系统会根据你的注解自动映射对应的数据表,实现几乎xml文件的零配置。 例如: @Entity @Table(name="user_info") //这个注解表...
就放在classes/目录下 sessionFactory = new Configuration().configure("WEB-INF/hibernate.cfg.xml").buildSessionFactory(); hibernate实现有两种配置,xml配置与注释配置。 一、hibernate.cfg.xml jdbc:mysql://localhost:3306/webases org....
spring已经提供了管理hibernate的接口,所以这个配置文件没必要写.
您好,提问者: 你的配置是完全没有问题的,不过提醒你一下,最好按照jdbc加载的顺序来配置 hibernate.connection.driver_class hibernate.connection.url hibernate.connection.username hibernate.connection.password 关于跟踪不进去问题: 1...
hibernate.cfg.xml中写的是链接数据库的四个信息,在Myeclipse开发工具中是可以自动生成的,名字也可以自己定,它的默认名字就是hibernate.cfg.xml,加上个.cfg就是为了明显看出是个配置文件,名字无所谓,
http://blog.csdn.net/zxd861114/article/details/5217646 请参考上文
在实际开发中一般都是hibernate.properties和hibernate.cfg.xml结合使用。一般在属性文件hibernate.properties中存放数据库连接相关的操作数据,在hibernate.cfg.xml文件中存放映射配置,在Users.hbm.xml(.hbm.xml之前的Users时自定义的,可以...