Author
Connecting to multiple DataBase
v chenna
Greenhorn
Joined: Dec 28, 2009
Posts: 12
I am developing struts application which it has to support to connect multiple databases with out changing the code.
For example, client has his own choice to select a data base(Oracle,SQL Server,My SQL...) code has to support.
please provide the code or any link or clue for this
bye.
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
posted Feb 09, 2010 10:50:32
0
This doesn't really have anything to do with Struts, but with how you're accessing the database in the first place.
Unless you're using an ORM, you're going to have issues.
v chenna
Greenhorn
Joined: Dec 28, 2009
Posts: 12
Without using DAO or ORM tools is it possible. like can we go using Resource Properties file
Ernesto Chicas
Greenhorn
Joined: Jan 13, 2010
Posts: 18
I do not know if you've considered the possibility of using and combining spring with hibernate to use multiple datasource
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
posted Feb 09, 2010 16:35:09
0
How are you doing your queries? Do you need to generate new database rows that would need a unique ID? How would you overcome SQL differences?
I'm moving this to JDBC .
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6588
How would you overcome SQL differences?
Yep. That is an important question - that.
Depending on whether you are dealing with the same tables / queries the answers vary.
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Joined: Aug 26, 2006
Posts: 4967
V. Chenna, please do not crosspost:
Crosspost of this Question
Author of Hibernate Made Easy , What is WebSphere??? , JSF 2.0 Made Easy and the SCJA Certification Guides
subject: Connecting to multiple DataBase