The basic steps are to first define a *-ds.xml file for your database. Examples can be found at docs/examples/jca. Then in your application, you can look up the datasource using JNDI and from there get the JDBC connection:
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:myDS");
Connection c = ds.getConnection();
When you are done, close the connection to release it back to the connection pool.