Selenium Webdriver is a web test automation framework and primarily used for functional testing of front-end part of the application (that piece, that the user sees in his/her browser).
Since this framework is open source and can be relatively easily extended, someone could have already implemented some additional libraries for interacting with the database. But as I've already said, this is not the primary goal of framework.
I'm assuming you don't need to test your database in a very special way so that I would advise you to take a look at Robot Framework, which is also web testing automation framework with great community and short learning curve.
With help of Robot Framework, you can easily combine both "front-end" testing with database testing, since it already has available database libraries, which extend its' functionality and don't require you to write much code.
The very good thing about Robot Framework is that you can to either use existing libraries or write your own in order to extend the framework's functionality in the way you need. Moreover you can do it with Java or Python.
Here are the examples of Robot Framework database libraries: