-->
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.  [ 1 post ] 
Author Message
 Post subject: How can I load JDBC driver's jar files dynamically?
PostPosted: Tue Oct 17, 2006 3:49 am 
Newbie

Joined: Tue Oct 17, 2006 3:29 am
Posts: 1
Hibernate version: 2.1.8

Hi all,

I'm developing a GUI tool for manipulating datbases using Hibernate. I give users a dialog to enter their database url, user name, password and so no. The last thing users should enter is the locations of the JDBC driver's jar files, then the tool will use these information to connect the database.

My problem is that I cannot load these jar files dynamically, so Hibernate will throw an exception telling me that "JDBC Driver class not found". When I looked into the exception's stack trace, I found it was from net.sf.hibernate.connection.DriverManagerConnectionProvider's configure() method. So I went to check out the source code and I found that there is a Class.forName() statement.

I believe that if I can write my own ClassLoader and use it within the Class.forName() statement, then I can get what I want. But I cannot find any point that I can insert my own implementation to Hibernate's whole infrastructure. Is there any extension points or callback that I can put my implementation in? Or is there any other way that can solve my problem?

Thanks a lot.


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

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.