making sure the database is connected

Getting driver name throws exception (see below), when database is not connected. This may happen when extending Query Builder with driver-dependent functionality (LIMIT and OFFSET on Access or SQL Server, for instance).


```
ErrorException [ Fatal Error ]:
Call to a member function getAttribute() on a non-object
```