Context ctx = new InitialContext();DataSource ds = (DataSource)ctx.lookup("jdbc/sample");Connection con = ds.getConnection();