Solved

using a Web.Config in java

Posted on 2009-07-09
12
922 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
  • 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

743 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now