File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes problem in hibernate code Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "problem in hibernate code " Watch "problem in hibernate code " New topic
Author

problem in hibernate code

Hamzah khammash
Greenhorn

Joined: Jan 05, 2012
Posts: 15

Hello , i am new to hibernate and this stuff ,i try to code a student-course example hibernate but always got a set of exception
this are the exception i will but the hibernate.cfg.xml file and the main class and factory class and hope somebody helps me in this example i used Mysql database:

here is the factory class which is the factory of SessionFactory
and my main class is : and my XML File is
so any help will be appropriated .
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3563

You have to define the xml declarations in the config file above <hibernate-configuration> tag. Check the sample code from Hibernate distribution to get the correct code.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
 
subject: problem in hibernate code
 
Threads others viewed
Could not parse mapping document from resource developerhelpway/hibernate/employee.hbm.xml
session null
Getting exception of org.dom4j.DocumentException : feature read only while deploying war file in tom
Exception in ClassFormatError: Absent Code attribute
hbm file version working but annotation not
IntelliJ Java IDE