well I put mysql-connector-java-5.1.14-bin.jar in default/lib dir,
created mysql-ds.xml in defautl/deploy
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>DefaultDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/prova</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password>root</password>
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
but I have the error javax.naming.NameNotFoundException: DefaultDS not bound
both I use
ds = (DataSource) PortableRemoteObject.narrow(ictx.lookup("java:DefaultDS"), DataSource.class);
or
ds = (DataSource)ictx.lookup("DefaultDS");