To achieve this follow below steps:
1. Login to Weblogic server console using http://<hostname>:<port>/console
2. Expand Services and click on Data Sources
3. Click on New and select Generic Data Source
4 Enter below entries and click Next
5. Keep default value and click Next
6. Click Next
7. Enter below entries according to your DB details and click Next
8. Click on Test Configuration, if below entries are correct then Connection would get succeeded and click Next.
9. Select Server on which you want to deploy datasource. In this case we have only DefaultServer, click DefaultServer and click Finish.
10. testDS will get created and same can be used to get database connection.