Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    get all available DataSource names??

    Is there a way to get all available DataSource names from within a servlet?

    For example, in my DataSourceLoader servlet I want to iterate all known DataSources and inspect their config. Something like ...

    DataSourceManager.getDataSourceNames();

    So far, I can do this...

    String[] names = new String[] { "foo", "bar" };
    for (String n : names) {
    DataSource ds = DataSourceManager.get(n);
    Object o = ds.getConfig().get("requiresRole");
    // etc.
    }

    I'd like to do this...

    List<String> names = DataSourceManager.getDataSourceNames();
    for (String n : names) {
    DataSource ds = DataSourceManager.get(n);
    Object o = ds.getConfig().get("requiresRole");
    // etc.
    }

    SmartClient version: v9.0p_2013-07-11EVAL

    Thanks,
    Chris

    #2
    "All available DataSources" is not a straightforward concept given the ability to define DataSources on the fly (DynamicDSGenerator), internal system DataSources such as the default component schema, etc.

    If you have a particular set of application-specific DataSources, we would suggest simply taking a list of the directory where they are contained.

    Comment


      #3
      Thanks!

      Reading file names from the ds directory and stripping the ".ds.xml" suffix works for me.

      Comment

      Working...
      X