In my project i need to switch between databases during runtime. I tried to use Hibernate, but stuck in a place, where i need to map object with table in database. The problem is, that i have several tables with prefix: documents2001, documents2002 ... As i understood, i can t map class with table during runtime. I tried using iBatis, but the problem is in database changing during runtime. In iBatis, it is quite hard to do.
Maybe some advices, what should i use?
My requirements:
- Ability to connect to different databases during runtime
- Ability to change table during runtime(if class is mapped to table, like it is in Hibernate).
UPDATE:
Ok, i`ll try to explain:
I have to write application, which can connect to different databases during runtime. User of app can choose, which database to connect. All databases are with same structure. Additional to this, user can switch between tables in database. Tables are with the same structure.
- Why i assumed, i can not use Hibernate: In Hibernate class is mapped with table, so i can not change table during runtime. This does not allow me to choose table, to which i can connect.
- Why i assumed, i can not use iBATIS. In iBATIS it is very hard to connect to different database during runtime. So, user will not be able to connect to different database during runtime.
Maybe there is another tool i can use?