The code itself is the same whether you use connection pooling or not. When you set up the ds1 datasource, it uses a certain class from the driver. That class determines whether connection pooling is used. For example, db2 provides a non-connection pool datasource, a connection pool datasource and an XA (transactional) datasource in the driver zip file.
Each JDBC data source has a pool of JDBC connections that is created when the data source is deployed or at server startup. For this to work, you must first configure a connection pool in WAS and then associate your DataSource with the pool.
The code you have posted will obtain the connection wrapper object from the pool.