Solved

using a Web.Config in java

Posted on 2009-07-09
12
927 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to convert from xls to xlsx using java 7 161
add projects t working set in maven 2 71
swing controls 2 38
Setup GlassFish 4 56
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

752 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