how to configure JNDI for mySQL database?

I am using SUn Java studio Enterprise to write portal/web application. I use MYSQL and mySQL-Connector/J driver. If I use JDBC, I can connect .

But if I change to JNDI,:

Context ctx = new InitialContext();

DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/portaldb");

conn = ds.getConnection();

I cant get DataSource or Connection. I noticed there are some option in the tool to configure connection pool, I tried and it seemed correct, but I still dont get DataSource or Connection.

Can anybody help?

Thanks!

[567 byte] By [qosa] at [2007-10-2 5:47:33]
# 1
http://docs.sun.com/source/819-0079/dgjdbc.html
xHackera at 2007-7-16 1:57:09 > top of Java-index,Core,Core APIs...