I've searched the forums for this and I can't seem to find an answer. I'm probably not asking the question correctly, so I'll try to explain it here. I put this in the Websphere forum because it seemed the most appropriate. Please feel free to move this to another forum if appropriate.
For the purposes of this question, assume that:
- we have a single server with three websphere server instances, running on ports 9080, 9081, and 9082. Those represent
test, QA, and production.
- we have three different databases representing test, QA, and production.
- for each environment, such as QA, the tables are not all located in the same qualifier. For example, the QA environment there might be QA1.employee, QA2.account, etc...
- we are using Websphere 6.1 on a Windows server.
Now, when you write an SQL statement in your code, you want to be generic and say "Select * from employee", except that in one environment, it might be "TEST1.employee" and in another environment, it might be "QA1.employee".
How do you set up a datasource in Websphere so that you can write generic SQL? Currently, we have code that substitutes the proper qualifier based on looking up the host name you are running on. This isn't a great approach because if the application is moved to a different host, we have to recompile, retest, and redistribute. Granted its not a huge change, but it's still a change.
If anyone has a link they can point me to, that'd be fantastic.
Thanks in advance.