Reputation: 61
I'm working on Java with an application that persists in Oracle and PostgreSQL (not at the same time). I'd like to get the type of the database that is currently running because I need to work in a different way depending on whether it's oracle or it's Postgresql.
Upvotes: 0
Views: 72
Reputation: 5291
JDBC API should help: getDatabaseProductName(). There are other methods as well that allow to get the product version and the driver name and its version.
Upvotes: 3