-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: classpath for database driver in Eclipse hibernate console ?
PostPosted: Tue Feb 01, 2005 10:18 am 
Newbie

Joined: Tue Feb 01, 2005 10:12 am
Posts: 2
How can I the right classpath for database driver in Hibernate Console in Eclipse ?

The dialog displayed by the wizard only allows my to add a directory, and not the jar that is found in the directory ?


Top
 Profile  
 
 Post subject: Re: classpath for database driver in Eclipse hibernate conso
PostPosted: Tue Feb 01, 2005 10:42 am 
Newbie

Joined: Tue Feb 01, 2005 10:12 am
Posts: 2
joeatergo wrote:
How can I the right classpath for database driver in Hibernate Console in Eclipse ?

The dialog displayed by the wizard only allows my to add a directory, and not the jar that is found in the directory ?


Solved, please ignore


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 02, 2005 2:59 pm 
Newbie

Joined: Mon Jan 31, 2005 7:43 pm
Posts: 7
Can you give the details of solution. I am hitting the same issue .

thanks
cmpuser


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 02, 2005 4:01 pm 
Newbie

Joined: Wed Feb 02, 2005 3:40 pm
Posts: 1
I suspect you are having the same problem we just had. You need to add the jar files for the database drivers in the following way:

1. Create a folder in the project and copy the database driver jar files to it
2. Add these files to the project build path (do NOT use the add external jar, use the add jar)
3. Now create the mapping config and the console config. When you create the console config the path to the database driver jar file should show up automatically in the config screen

Aron Cox
Capilano Caollege
acox@capcollege.bc.ca


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 02, 2005 7:12 pm 
Newbie

Joined: Mon Jan 31, 2005 7:43 pm
Posts: 7
Thanks that did the job.

cmpuser


Top
 Profile  
 
 Post subject: Re: classpath for database driver in Eclipse hibernate console ?
PostPosted: Fri Oct 16, 2009 7:18 pm 
Newbie

Joined: Fri Oct 16, 2009 7:11 pm
Posts: 2
I can add the hsql.jar manually.

However, my problem with that is that the hsql.jar is named in the pom.xml as a dependency and it is added to the repository. Also, all the database connection details are defined in the hibernate.cfg.xml.

The project can get other jars when it needs them, but can it also get the hsql.jar when it is needed? E.g. can't it be started/stopped from some other plugin as a data source view on Eclipse?

It may need to be given a cue to start/stop, since the tutorial in the Hibernate manual (Chapter 1) manually starts it with "mvn exec", or I can start it with Java manually.

However, I want to be able to do it from an Eclipse plugin, so I don't have to resort to command line, that forces me to leave Eclipse :-(

Thanks,
Yoichi


Top
 Profile  
 
 Post subject: Re: classpath for database driver in Eclipse hibernate console ?
PostPosted: Fri Oct 16, 2009 8:38 pm 
Newbie

Joined: Fri Oct 16, 2009 7:11 pm
Posts: 2
Hm, I figured it out a bit.

I can't still start/stop it from Eclipse with some Hibernate related plugins, but I can set up a Run configuration with Java application with:

Main tab:
Project = hibernate-tutorial
Main class = org.hsqldb.Server

Arguments tab:
-database.0 file:target/data/tutorial (this is where the data files will be created)

Classpath tab:
Bootstrap Entries: JRE whatever (automatically added)
User Entries: hibernate-tutorial (automatically added)
** Maven Dependancies ** (automatically added)

The Maven Dependacies is automatically generated by passing the pom.xml file, and the hsqldb.jar is listed as a dependency in there.

<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.1.1</version>
</dependency>

The point here is that you are not supposed to add any jars to the project directly (i.e. there is no /lib directory), but you must add dependency descriptions to pom.xml. Actual jars are added to the .m2/repository.

I think that the Maven dependencies was created after I ran "mvn compile", but not sure.

Also, I think that I had to add the hsqldb1.8.1.1.jar, javaasssit.3.9.0.GA.jar, servlet-api.jar, hibernate3.jar to the local repository myself. I was trying a few things, so I can't remember exactly, but Maven will tell you in the error message how to add them to the repository.

Yoichi


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.