Find below code to get database connection from your web app server. Just create datasource in app server and use following code to get connection :
// To Get DataSource
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("jdbc/abcd");
// Get Connection and Statement
Connection c = ds.getConnection();
stmt = c.createStatement();
Import naming and sql classes. No need to add any xml file or to edit anything in project.
That's it..