Menu

creating tyrex DataSources dynamically

Help
2002-09-20
2002-09-26
  • jason monberg

    jason monberg - 2002-09-20

    i'm interested in creating DataSources for tyrex domains dynamically as well as through the configuration file.

    I think the correct process is something like:
    create an EnabledDataSource
    get the Resources from the domain
    use the Resources addConfiguration method to add a ResourceConfig object to the Resources.

    if this is correct i'm not sure what to do with the ResourceConfig object.

    if this is not correct would love a pointer to a simple example or code snippet showing how to do this.

    thanks,
    jason

     
    • Riad Mohammed

      Riad Mohammed - 2002-09-26

      Hi Jason,

      Sorry for the late reply.

      The ResourceConfig contains the factory for creating the actual resource. In your case the factory is the EnabledDataSource.

      So off the top of my head:
      create an EnabledDataSource
      create a tyrex.resources.jdbc.DataSourceConfig
      dataSourceConfig.setFactory(enabledDataSource);
      dataSourceConfig.setName(<uniqueName>);

      dataSourceConfig.getResource(domain);
      // at this point the connection pool will be set for
      // the enabled data source

      Riad

       

Log in to post a comment.