Websphere Datasource Properties File
6th Step – Do the left steps to pay your money and finish your order. None of their Decipher Tools products are a monthly subscription and you will NEVER be billed monthly for any of their programs. Catch this great chance to give your wallet a rest by Decipher Tools Coupon.HotDeals is the best place to be if you are hoping to get the biggest Decipher Tools savings. 5th Step – If you have an account at Decipher Tools, just sign in; and then continue to check out, and apply the code. FAQs Q: Do I have to pay a monthly subscription for Decipher Tools?
- Websphere Datasource Properties File Download
- Basic Datasource Properties
- Oracle Datasource Properties
- Websphere Datasource Properties File
- Datasource Properties
I would really like to use a properties file so that I can easily switch between our development database and our production database. If anyone could help me out, I'd really appreciate it!
Thanks.
To delete an existing object property, specify DELETEPROP=true in the header of the properties file. To delete an existing object, specify DELETE=true in the header of the properties file. Run the applyConfigProperties command to apply the properties file and change your configuration.
posted 17 years ago- How to configure WebSphere Application Server data source for SSL Encryption to Microsoft SQL server? Create any missing data source custom properties. The path (including filename) to the certificate trustStore file. The trustStore file contains the list of certificates that the client trusts.
- 2) Does using the properties file create any security holes, ie is anyone able to access this file through the browser? If this is the case, we cannot use the properties file as the intruder would then find the database name, username and password. I have the properties file in my WEB-INF/classes/. Please let me know if this is a problem.
could u pl specify whether u r using the properties file from a servlet in a war file or from a EJB in a jar file.
if servlet u can specify the path in the init parameter and read it within ur servlet. or u can load it using
InputStream is = getClass().getResourceAsStream('/rollout.properties');
Properties props = new Properties();
try
{
props.load(is);
}
catch (Exception e){}
if u want to load the properties file with in ur EJB then u can make use of the Environment variables.
hope this helps.
Thanks<br /> <br />Kiran <br /> <br />SCEA, SCJP 1.4,<br /> <br />'First they ignore u, then they laugh at u, then they fight u, <br />then u will win<br /> <br />Mahatma Gandhi'
ResourceBundle bundle = ResourceBundle.getBundle('sampleConfig.properties');
..
String value1 = (String)bundle.getObject('Key1');
...
Hope this helps.
PJ
[ July 30, 2002: Message edited by: Prashanth Joisha ]
For WAS, the .properties file goes into your 'Document Root', which is a directory you specify per web application. You find the setting for this in the properties for the web application.
Regards
Seema Verma
Originally posted by Prashanth Joisha:
The easiest solution would be to use a ResourceBundle (specifically PropertiesResourceBundle) ... place your properties file say sampleConfig.properties under ejbModule (for EJB Projects) or source directory for a Web project. Now in ur class file you need to have something like this ..
ResourceBundle bundle = ResourceBundle.getBundle('sampleConfig.properties');
..
String value1 = (String)bundle.getObject('Key1');
...
Hope this helps.
PJ
[ July 30, 2002: Message edited by: Prashanth Joisha ]
On Green Dolphin Street - Miles Davis & John Coltrane 16. Dizzy gillespie torrent flaco.
Websphere Datasource Properties File Download
posted 17 years agoPJ
[ August 06, 2002: Message edited by: Prashanth Joisha ]
and using ResourceBundle to extract the values,it works fine ,Is there any thumb rule that specifies that property files should be here or there?
Of course it isn't so much of a problem if you don't have EJBs or they don't have to share properties.
Dave
You can always set the working directory of the application server and then pick up the properties file relative to the working directory. This allows EJBs and Web apps to access the same properties files.
I hope helps.
Cheers,
Steve
We're currently in the process of evaluating our use of properties (on Websphere) to come up with 'something better', but asn efficient solution to the distributed thing is a bit of a poser.
If you are looking for a single repository for properties in a distributed environment you should probably be looking towards either a directory service such as LDAP or using a database to store the information.
The problem with only having one place for all the properties for all the servers is that you introduce a further single point of failure! If the database/directory service fails then all your servers are likely to suffer unless they cache the properties at startup - though they could still experience problems if you need to restart the servers.
You need to weigh up whether you require redundancy and failover or this single repository.
Cheers,
Steve
I've tried some of your responses. Here's our scenario: we're using JSP and servlets on WAS 403 running on AIX, with Apache 1.3.20 Web Server. We're using only one app server. The JSP and servlets access JavaBeans. We're not using EJB's. The JavaBeans then need to create a connection with the database. My purpose of using the properties file is for an easy way to switch between our production and development databases. We have different database names and usernames and passwords for prod and dev. Therefore, I would like an easy way to change these values without having to modify the constants in the JavaBean. That said, here is how I'm trying to use the properties file:
I have created a properties file called test.properties with the following data:
I then have this code in my JavaBean:
I have tried specifying the full path to the properties file; however this doesn't work either. The message in the log is:
I have the properties file in /usr/apps/WebSphere/AppServer/installedApps/test-dev.ear/test.war/WEB-INF/classes/test directory. The test directory at the end is also where the class file for my JavaBean resides.
Can someone please tell me how I should be referring to the properties file? I'm not sure if the problem is how I'm referring to it or where I'm putting the file. The properties file has full permissions (777).
Any direction on this issue is greatly appreciated!!
[ August 12, 2002: Message edited by: verduka fox ]
PJ
bundle = (PropertyResourceBundle)PropertyResourceBundle.getBundle('test.properties');
to:
bundle = (PropertyResourceBundle)PropertyResourceBundle.getBundle('com.mycompany.myproject.test');
Now it seems to work. One last question: when I change values in the properties file, should I have to stop and start the app server for these changes to be recognized? I didn't think I would need to, but from my testing it seems as though this is required. Can anyone comment on this?
Basic Datasource Properties
posted 17 years ago[ August 12, 2002: Message edited by: verduka fox ]
1) When I change values in the properties file, should I have to stop and start the app server for these changes to be recognized? I didn't think I would need to, but from my testing it seems as though this is required. Should this be the case?
2) Does using the properties file create any security holes, ie is anyone able to access this file through the browser? If this is the case, we cannot use the properties file as the intruder would then find the database name, username and password. I have the properties file in my WEB-INF/classes/.. folder. Please let me know if this is a problem.
Your expertise in this area is really appreciated!
Can anyone comment on my two final issues with using the properties file please:
1) When I change values in the properties file, should I have to stop and start the app server for these changes to be recognized? I didn't think I would need to, but from my testing it seems as though this is required. Should this be the case?
2) Does using the properties file create any security holes, ie is anyone able to access this file through the browser? If this is the case, we cannot use the properties file as the intruder would then find the database name, username and password. I have the properties file in my WEB-INF/classes/.. folder. Please let me know if this is a problem.
Your expertise in this area is really appreciated!
Oracle Datasource Properties
posted 17 years agoAs for [1] how do you obtain your properties? Do you use ResourceBundle.java or do you use getSystemResourceAsStream? If you use the former, then you have to bounce your adminserver (90% sure). If you use the latter, I don't know, I would guess that it should be read from the classpath each time.
-t
Websphere Datasource Properties File
Also, if you read Sun's java spec, you will see that files in the WEB-INF directory are not accessible.
BTW - the WSAD 4.1 version is a little less buggy than 4.0.3.
I've found that certain key stroke combinations in 4.0.3 brings it down.
I typically create a resource servlet that bootstraps at load time of the servlet container. The resource servlet then gives access to the properties fields. I usually define an init parameter to my resource servlet in the web.xml file. This init parameter is the name of the properties file that I want to gain access to.
Then if you place the file in the same location in your sources directory in WSAD as your servlet, you can use the following code snippet.
String dataSource = getInitParameter('dataSource');
URL configURL = getServletContext.getResource(dataSource);
Properties props = new Properties();
props.load(configURL.openStream());
If you want to pass the properties to an ejb container, make sure your method signature to the ejb contains an environment variable. This environment variable should be a hashtable (or HashMap) containing all your needed properties by the ejb layer.
[ August 24, 2002: Message edited by: Ron Ditch ]
Datasource Properties
The properties file is in the applications root directory along with the supporting jars.
Any ideas?
thanks