I would like to set up a DBCP connection pool for my stand-alone
application (so not in Tomcat, for which documentation is abundant).
However, I keep getting an "javax.naming.NameNotFoundException: Name
jdbc is not bound in this Context" exception. I have tried everything I
could think of and I'm stumped.
First of all, I tried following the tutorial at
After replacing the driverClassName, url, username and password with
real values, this code gives me the NameNotFoundException when I try to
rebind however. So I tried adding the line
ref.add(new StringRefAddr("dataSourceName", "jdbc/sender")); (before
but this improved nothing. So I then tried creating a BasicDataSource
by hand as follows:
BasicDataSource ds = new BasicDataSource();
Context ctx = new InitialContext();
It gives exactly the same error. Obviously I'm missing something
crucial here, but many hours of Googling have not turned up an answer
Could someone please point me in the right direction?
Thanks very much, Jonck