Develop your own GetSchema() method that queries the DBC.Databases view:
public static String getSchema (Connection con)
throws SQLException
{
Statement stmt = con.createStatement () ;
try {
ResultSet rs = stmt.executeQuery ("SELECT DatabaseName FROM DBC.Databases WHERE DBKind = 'D'") ;
try {
rs.next () ;
return rs.getString (5) ;
} finally { rs.close () ; }
} finally { stmt.close () ; }
}
If you want to be a little more discrete in the objects that are displayed then you can use additional logic to specify the UseXViews parameter in the connection string to return only those objects the user has been provision access to through explicit or implicit permissions.
Links point to the web sites used to provide answer.