Is there a way to detect the ODBC database currently being connected to with Java?
For example, I would like to know whether an application is currently connected to Oracle 10g or SQL Server 2005.
Thanks in advance.
Is there a way to detect the ODBC database currently being connected to with
Share
If you have
java.sql.Connectionclass,getMetaDatamethod will return database information. FromDatabaseMetaDataobject you can retrieve all kinds of stuff, like driver name or connection url, to determine your kind of server. edit There’s alsogetDatabaseProductNamemethod there.