cancel
Showing results for 
Search instead for 
Did you mean: 

How to get list of JDBC dataSourceNames in java code

Former Member
0 Kudos

Hi Gurus;

Can i get list of JDBC dataSourceNames in java code ?

Anyone knows?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Problem solved

Former Member
0 Kudos

Hi

Please check if the following link helps you:

http://java.sun.com/products/jdbc/faq.html

and

http://www.oop-reserch.com/simple_dao.html

Regards

Chen

Former Member
0 Kudos

Thanks for links but they are not answered my question.

I have this code ;

			try {
				javax.naming.InitialContext ctx = new javax.naming.InitialContext();
				javax.naming.NamingEnumeration enm = ctx.list("");
				while (enm.hasMore()) {
					javax.naming.NameClassPair entry = (javax.naming.NameClassPair)enm.next();
					out.println("<br>"+entry.toString());
				}
				
			} catch (Exception e) {
				out.println(e.toString());
			}

but this gives me;

java:comp

this "java:comp" is a directory of JNDI Registry.

JDBC datasource is a subdirectory of JNDI Registry too.

Is there any way to list all JNDI Registry and it's subdirectories?