make adatabase connection by reading from a properties file

i have following five instances

x,y,z,a,c

for

x it has the processes wp,we,dg

y it has the processes wp,we,wa

z it has the processes wp,dg,wa

a it has the processes wp,dg,wa

c it has the processes wp,dg,wa

connection is to be made by reading from a properties file containing the instances & processes.

[362 byte] By [Priyoa] at [2007-11-27 10:21:58]
# 1

And your question is?

masijade.a at 2007-7-28 17:13:10 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

how to put these instances and their processes in a properties file and make the connection to database?where the user id and password will be given by the user.

Priyoa at 2007-7-28 17:13:10 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3

Do you know how to load properties files?

Do you know how to retreive the String value of specific property keys?

Do you know how to concatenate Strings?

Do you know how to use Class.forName()?

Do you know how to use DriverManager.getConnection()?

If you can answer yes to all five of the above questions, then you have everything you need. If not, which question did you answer no to?

masijade.a at 2007-7-28 17:13:10 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4

can you send one sample code?

Priyoa at 2007-7-28 17:13:10 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5

Give it a try and if it doesn't work, post what you've written and we will help you correct it, but I, for one (and most of the others also), am not going to do it for you.

We are more than willing to help, but hand-outs are a different story. If you want someone to code it for you try http://www.rentacoder.com/

masijade.a at 2007-7-28 17:13:10 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...