I noticed that Spring is able to obtain the database vendor info from the datasource for it's SQLException handling.

I looked around in the SQLErrorCodesFactory and I see that it calls JdbcUtils to extract the database meta data with a internal implementation of DatabaseMetaDataCallback.

I was looking to use this kind of functionality in my code, and I was wondering if I was missing someting. Is there a method I can call to obtain the database metadata, or do I need to re-implement the code used in the SQLErrorCodesFactory?

I would imagine that this could be a useful feature to have in the jdbc package. (obtaining database information from the datasource)