on 06-20-2007 7:04 PM
Hi All,
I know the subject may be misguiding, but i need some suggestions how to handle the following scenario.
From my XSLT mapping, i am calling a java function which performs a data connection to an oracle database and then returns some values, whcih i have mapped in the mapping.
The problem is, i have hardcoded the Connection parameters....
and now that we transport these objects to production, the connection parameters will change.
I thought of two solutions
1) i create a new java class for Production system
2) i define the parameters as input arguemnts to my method, whcih is called from XSLT mapping
But in both cases, if theres any chg in future, there will a dependancy on one of the objects to be changed and sent again.
What is the suggested way? is there nothing like a property file(like in EP), where you define dependant parameters...and the file is only changed.
XI Gurus, please suggest me the correct way to handle.....
Thanks a lot.
Mona
Mona,
This is exactly why you should use the JDBC LookUp Concept as disccused in this blog,
/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
Create a Business Service and a Receiver JDBC adapter and this remain the same as you tranport it across environments. You can change the connection parametrers in the Comm Channel without touching your Look Up code.
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mona,
This is what i do..
1) Parametrize ur current calling class,
2) define a separate class called dbConnect.java there, you have all your parameters that way when there is a change your main program is untouched, and you just need to change the dbconnect.
The call from your current class will be just like
dbConnect.Runsql("sql as a string");
the runSql can then internally call
dbConnect().connect(); //that should do the connection opening.
then create a prepared statement from your string input and call the db.......
this is the implementation that would be best suited for your scenario, you can further parametrize the method to where you can add the database params from the calling xml..so all that needs to be done when the machine is changed or any param is changed is ..modify the xml........not too bad was that.....
Regards
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, the setup i suggested is a one time, by definition in java you should be calling a dbconnect to connect to the db and also to run the sql code.
yes you might have to modify your transports. that should be the last problem you have..ever..good design takes care of issues that may come up later..and you have done that now with the change..
Have fun
Regards
Ravi Raman
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.