Hibernate version:
3.0.5
Hi,
I’m working on a swing client application that must use give the user the option to create a new or use an existing database each time it runs. So I must be able to dynamically (at run-time) get a list of all of the existing (previously created by the user) databases or create a new one, with a name given by the user.
I’m using MySQL 4.1 and I have my db connection info, etc in hibernate.config.xml.
How can I do the following things:
1. Get a list of all the existing databases. Is there an HQL similar to SHOW DATABASES that will return a list of databases?
2. programmatically override or add to my hibernate.config.xml that is in my applications .jar file to tell hibernate to use a particular dbase. I suppose I should use something like:
Configuration().setProperty("hibernate.connection.datasource", "dbase name")
Is is possible to override just one property in the hibernate.config.xml and keep the rest?
Thanks for your help,
Steve
|