Sorry for miscopy in my previous email! The code in my function is : javax.naming.Context ctx = new InitialContext(); DataSource dbs = (DataSource) ctx.lookup("jdbc/Customer"); Connection aConnection = dbs.getConnection(); Statement QStatment = aConnection.createStatement(); ResultSet Result = QStatment.executeQuery("select max(ID) from customer");
And I specified the resource reference in both web.xml and jboss-web.xml as following: 1. web.xml <resource-ref> <description> The default DS </description> <res-ref-name>java:/DefaultDS</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> 2. jboss-web.xml <jboss-web> <resource-ref> <res-ref-name>java:/DefaultDS</res-ref-name> <res-type>javax.sql.DataSource</res-type> <jndi-name>jdbc/Customer</jndi-name> </resource-ref> </jboss-web> 3. the JDBC part in jboss.jcml file is: <mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=MySQLDS"> <attribute name="PoolName">DefaultDS</attribute> <attribute name="DataSourceClass">org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl</attribute> <attribute name="URL">jdbc:mysql://localhost/Customer</attribute> <attribute name="JDBCUser">root</attribute> 4. the jaws.xml file is : <jaws> <datasource>java:/DefaultDS</datasource> <type-mapping>mySQL</type-mapping> Now, I am getting error: jdbc not bound. Would anyone tell me what mistakes I made? Any suggestion will be appreciated! Regards, -- Jia (Christine) Li 524N ICT Building Department of Computer Science University of Calgary _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user