currentUsedDatabase()
This operation returns the name of the database currently being used by this client.
public String currentUsedDatabase()
RETURNS:
String
The name of the currently active database.
Example
String dbName = client.currentUsedDatabase();
System.out.println("Current database: " + dbName);