I am trying to make a connection to a database manager (postgresql, Mysql and Access) and I would like to know if there is any way to connect to the manager and extract the information from the name of the databases that are stored there. All this using JAVA. I need to obtain the name of the databases stored in the 3 managers not at the same time but using different functions, methods or classes. I'm following the standard procedure of connecting to a database, but I do not want to connect to a specific one but I want to get the name of all of them.
String stringConnection = "jdbc:postgresql://" + this.host + ":" + this.port + "/" + this.database;
Class.forName("org.postgresql.Driver").newInstance();
conn = DriverManager.getConnection(stringConnection, this.user, this.password);
//Son las principales líneas de conexión que estoy empleando.