Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate

 
meena latha
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all .

Not sure where to post this.Anyhow below is my problem.
I am trying to learn hibernate.
I found out a link http://www.onjava.com/pub/a/onjava/2004/06/23/hibernate.html?page=1thats says how to work with hibernate.
It will be great if you can let me whether i can try out this using Eclipse,Tomcat server and MSAccess as the data base.

Thanks in Advance
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The use of Tomcat is totally orthogonal to Hibernate.

Eclipse doesn't stand in the way either. In fact there are some eclipse plugins for hibernate that might help (google for them), although they are not a prerequisite.

I'm reluctant to call MS Access a *database*, though. Not sure wether Hibernate is able to handle that thing.

Moving to our ORM forum...
 
meena latha
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I totally understand that MS Access is not a right choice.
So let me put my question this way to basically practise Hibernate from home what should i basically have.

Thanks
Ramya.A
[ December 28, 2005: Message edited by: ramya jai ]
 
Jignesh Patel
Ranch Hand
Posts: 626
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use HQLDB, coming with Hibernate, which I have never tried.

And if you have MYSQL or any other relation DB.
Create a database connection by using type3 or type 4 driver with DB.
Check the connection is created properly.

Once it is done
create a test table with 1 or 2 column.
crate a class with getter and setter methods for those columns.
crate a hibernate mapping in hbm.xml file(make sure the file is in your classpath.
create a client class, pass a value and see whether it is stored or not.

You don't need any container for this. POJO is enough.
 
Michael Duffy
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ilja Preuss:
The use of Tomcat is totally orthogonal to Hibernate.

Eclipse doesn't stand in the way either. In fact there are some eclipse plugins for hibernate that might help (google for them), although they are not a prerequisite.

I'm reluctant to call MS Access a *database*, though. Not sure wether Hibernate is able to handle that thing.

Moving to our ORM forum...


There's no support for Access in Hibernate.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Duffy:
There's no support for Access in Hibernate.


Touch´┐Ż
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Duffy:


There's no support for Access in Hibernate.


Not 100% accurate. You can use the JDBC/ODBC bridge and the basic dialect. If your queries very basic, it will work, most of the time.
 
Michael Duffy
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:


Not 100% accurate. You can use the JDBC/ODBC bridge and the basic dialect. If your queries very basic, it will work, most of the time.


Which SQL dialect do you tell Hibernate to use in that case? GenericDialect?

I thought I read that there was no support for Access in Hibernate, but that might have been true of 2.x.

I see that NHibernate supports Access now, but there was no such thing when I first became aware of Hibernate.
 
Daniel Prene
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't consider using any hibernate plugins untill you've learned hibernate. Once you know hibernate you can go two ways: One, use the plugins wihout taking away valuable experience and learning, or two, realize that most of the plugins suck and aren't worth using.

Good luck!
-D.P.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic