java:/TestDS problem

10 views
Skip to first unread message

vikas.khengare

unread,
Apr 11, 2008, 12:23:53 PM4/11/08
to osjava
Hi Friends,
My old is like following,
DataSource ds = (DataSource) jndiCtx.lookup("java:/TestDS");

Now, I want to use same code but using Simple-JNDI.
How can I prepare this "java:/TestDS". using Simple-JNDI?

I have prepared directory structure like "/Simple_JNDI_DIR/config/java/
TestDS.properties" which has details as follows

type=javax.sql.DataSource
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/testdb
user=test
password=test

How can I change my directory structure so it will look for "java:/
TestDS"?
Any other solution for same situation? [I don't want to change old
code ie "java:/TestDS"]

Thanks

regards,
Vikas Khengare

Henri Yandell

unread,
Apr 11, 2008, 5:24:25 PM4/11/08
to osj...@googlegroups.com
I believe the following will work (can't recall right now whether
you'd need the / on the end of the sj.space parameter, or if you would
need to set the delimiter given that you're not using it, so play with
that a touch):

org.osjava.sj.root=/Simple_JNDI_DIR/config/java/
org.osjava.sj.space=java:

The following test is an example:

http://www.osjava.org/simple-jndi/xref-test/org/osjava/sj/EncTest.html

I'll make a note to improve how the manual talks about that.

Hen

Reply all
Reply to author
Forward
0 new messages