<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Obtain Database Name from Data Source? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/obtain-database-name-from-data-source/m-p/25245#M12455</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just to clarify things: We don't mean to change the database configuration at runtime.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We stumbled over this, when we studied the Spring examples. There one needs to pass a data source and a data base name to the org.activiti.spring.ProcessEngineFactoryBean, which passes it on to the ProcessEngineConfiguration. The DbSqlSessionFactory does:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.statementMappings = databaseSpecificStatements.get(processEngineConfiguration.getDatabaseName());&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;followed by:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataSource dataSource = processEngineConfiguration.getDataSource();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (dataSource==null) {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String jdbcDriver = processEngineConfiguration.getJdbcDriver();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String jdbcUrl = processEngineConfiguration.getJdbcUrl();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; …&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Deriving the string for identifying database specific statements from the JDBC URL would save users the additional configuration property. It somehow violates the concept of a data source if additional database settings are needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok, I just saw that the &lt;/SPAN&gt;&lt;A href="http://download.oracle.com/javase/1.5.0/docs/api/javax/sql/DataSource.html" rel="nofollow noopener noreferrer"&gt;interface javax.sql.DataSource&lt;/A&gt;&lt;SPAN&gt; doesn't seem to have methods for retrieving the JDBC URL. This explains the need for an additional property.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Sep 2010 12:50:04 GMT</pubDate>
    <dc:creator>falko_menge</dc:creator>
    <dc:date>2010-09-24T12:50:04Z</dc:date>
    <item>
      <title>Obtain Database Name from Data Source?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/obtain-database-name-from-data-source/m-p/25244#M12454</link>
      <description>Would it be possible to retrieve the database name from the data source, e.g., the JDBC URL? This way, the data source is the only configuration, which needs to be changed for switching to another DB, i.e., for continuous integration tests.</description>
      <pubDate>Thu, 23 Sep 2010 08:22:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/obtain-database-name-from-data-source/m-p/25244#M12454</guid>
      <dc:creator>falko_menge</dc:creator>
      <dc:date>2010-09-23T08:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain Database Name from Data Source?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/obtain-database-name-from-data-source/m-p/25245#M12455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just to clarify things: We don't mean to change the database configuration at runtime.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We stumbled over this, when we studied the Spring examples. There one needs to pass a data source and a data base name to the org.activiti.spring.ProcessEngineFactoryBean, which passes it on to the ProcessEngineConfiguration. The DbSqlSessionFactory does:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.statementMappings = databaseSpecificStatements.get(processEngineConfiguration.getDatabaseName());&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;followed by:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataSource dataSource = processEngineConfiguration.getDataSource();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (dataSource==null) {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String jdbcDriver = processEngineConfiguration.getJdbcDriver();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String jdbcUrl = processEngineConfiguration.getJdbcUrl();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; …&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Deriving the string for identifying database specific statements from the JDBC URL would save users the additional configuration property. It somehow violates the concept of a data source if additional database settings are needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok, I just saw that the &lt;/SPAN&gt;&lt;A href="http://download.oracle.com/javase/1.5.0/docs/api/javax/sql/DataSource.html" rel="nofollow noopener noreferrer"&gt;interface javax.sql.DataSource&lt;/A&gt;&lt;SPAN&gt; doesn't seem to have methods for retrieving the JDBC URL. This explains the need for an additional property.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Sep 2010 12:50:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/obtain-database-name-from-data-source/m-p/25245#M12455</guid>
      <dc:creator>falko_menge</dc:creator>
      <dc:date>2010-09-24T12:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain Database Name from Data Source?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/obtain-database-name-from-data-source/m-p/25246#M12456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Was writing: "How would you derive the JDBC URL when the user configures a data source (either through spring or in an app server environment)?&amp;nbsp; then we don't know what type of datasource.&amp;nbsp; so we can't cast to get to the jdbc details."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and then saw that you figured the same yourself &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Sep 2010 06:49:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/obtain-database-name-from-data-source/m-p/25246#M12456</guid>
      <dc:creator>tombaeyens</dc:creator>
      <dc:date>2010-09-27T06:49:07Z</dc:date>
    </item>
  </channel>
</rss>

