on 11-15-2006 2:14 PM
Usually i do:
String datasource_name =
"jdbc/SAP" +
(String) System.getProperties().get("SAPSYSTEMNAME")
+ "DB";
String contextUrl = "";
String contextFactory = "com.sap.engine.services.jndi.InitialContextFactoryImpl";
Properties properties = new Properties();
properties.put("java.naming.factory.initial", contextFactory);
ctx = new InitialContext(properties);
ds = (DataSource)ctx.lookup(datasource_name);
con = ds.getConnection();
But sometimes administrator don´t use the rule to put the ResourceName like "SAP is the system ID of SAP instance.
I am developing for DEV environment and have a specific datasource name, but after the track transport i will have for quality environment another datasource name, and the same will happen for production.
Any idea on how to realize a flexible solution CODE that can work for all environment?
If i use application properties, and deploy my project, make all transport AFTER via web, from WebDynpro content i can change the properties???
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Roberto,
You can pass the DB name as URL parameter. Any ways the Web Dynpro application will be an iView in the portal. You can set the parameter when you configure the iView or you can pass as dynamic parameter. Like this you can change the parameter any time you required. By using the following code you can read the parameter -
WDWebContextAdapter.getWebContextAdapter().getRequestParameter("dbname");
Regards
Abhilash
Hi
You can create the alias for DB and call it in your code
See this help
http://help.sap.com/saphelp_nw04/helpdata/en/ea/a418d295d4493fa51aaad026a756b3/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/82/fdbf2085f65f43a71e755fc904478d/frameset.htm
Kind Regards
Mukesh
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.