Solved

using a Web.Config in java

Posted on 2009-07-09
12
928 Views
Last Modified: 2012-05-07
In asp and vb world I used a web.config file to store db connection strings and other common stuff.

If there a similar thing that can be used in the Java world to store connection strings without having to recompile the application?  

thanks
0
Comment
Question by:noreenburke
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
12 Comments
 

Author Comment

by:noreenburke
ID: 24814649
FYI::: the db is oracle 10g
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 24814667
0
 

Author Comment

by:noreenburke
ID: 24814820
where does the properties file exist in the application?  

can you give a sample of a connection string inside this file?

Thanks
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Accepted Solution

by:
CEHJ earned 250 total points
ID: 24814923
0
 

Author Comment

by:noreenburke
ID: 24817125
Boy, I just don't think my brain is working today.

is a Properties file a Bean? servlet? xml? txt?  and where would it be stored in the application?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 24817165
Properties is a class in the API. It usually works with a file in the application, stored anywhere, but often in the classpath
0
 
LVL 92

Expert Comment

by:objects
ID: 24819067
you should define your database as a data source and specify the connection details in your apps context file and access it via jndi
0
 

Author Closing Comment

by:noreenburke
ID: 31601656
thanks for you help
0
 
LVL 92

Expert Comment

by:objects
ID: 24844834
For others reading this the accepted solution is completely unnecessary, there is already a standard method for providing connection details. Nobody doing Java web development uses a separate properties file to store these details :)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 24844903
Is it for server side configuration?
0
 
LVL 92

Expert Comment

by:objects
ID: 24844909
thats not even relevant
0
 

Author Comment

by:noreenburke
ID: 24848352
So what is the standard method.?
I gave the point the to cehj as he did give me some pointers.  I actually am defining the string in a bean and then calling that.

0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question