This content has been marked as final.
Show 1 reply
-
1. Re: java.lang.ClassNotFoundException: org.jboss.resource.ada
sbrbot Jan 11, 2004 1:38 PM (in response to masroor)"masroor" wrote:
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:/mySQLDS");
return ds;
Probably you know that this code you can use only if your client is using local interface. It does not work if you want to access it through remote interface!
If your mysql-ds.xml file looks like:<?xml version="1.0" encoding="UTF-8"?> <datasources> <local-tx-datasource> <jndi-name>MySqlDS</jndi-name> <connection-url>jdbc:mysql://brby:3306/jbossdb</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>sbrbot</user-name> <password>...</password> </local-tx-datasource> </datasources>
then your datasource is registered in JBoss JNDI tree as java:/MySqlDS not any other variant.
BTW, use com.mysql.jdbc.Driver, MM's driver is obsolete!