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.
|