It works fine for me. Are you sure, you used the right code? What does the following print:
DataSource ds = (DataSource) new InitialContext().lookup("java:DefaultDS"); // replace this with your datasource deployed in JBoss
con = ds.getConnection();
System.out.println("Connection is " + con);
org.jboss.resource.adapter.jdbc.WrappedConnection wc = (WrappedConnection) con;
Connection uc = wc.getUnderlyingConnection();
System.out.println("Underlying Connection is " + uc);