Solved

using a Web.Config in java

Posted on 2009-07-09
12
923 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wordmultiple challenge 12 116
@SBGen Method 3 35
nextBoolean(double p) for Random class 3 35
object oriented programming comparison 5 52
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…
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

948 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

20 Experts available now in Live!

Get 1:1 Help Now