I am not sure whether this is exactly your requirement or not

. I am confused with 'Pretest connection'.
According to my understanding you have configured some datasource in hibernate.cfg.xml as below,
Now you want to test this configuration. For this you need to configured datasource on server. For example on jboss we can configure datasource details in some xml file as below
You need to find out same for Websphere .After these configuration when you will start the server and deploy application(which will contains hibernate.cfg.xml file) you can access database connection as below,
or you can get hibernate session as below,