Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
linking_to_other_databases_jspx__8619
linking_to_other_databases_jspx__8619
In order to link to tables in another database, you must first tell the application server about that database by adding a datasource descriptor file.

...

Companyname
only supports external tables with single primary key field which must be of exact numeric type

...

, like bigint or integ.

To link to another database, edit the configuration file in Agiloft/wildfly/standalone/configuration/agiloft.xml and add a custom data source to it. 

Code Block
<datasource connectable="false" enabled="true" jndi-name="java:jboss/datasources/SWDictionaryDS" jta="true" pool-name="SWDictionaryDS" spy="false" use-ccm="true" use-java-context="true">
<connection-url>jdbc:mysql:///sw2_std?socketFactory=org.newsclub.net.mysql.AFUNIXDatabaseSocketFactoryCJ&sslMode=DISABLED&junixsocket.file=/opt/server/Agiloft/mysql/ewdbsocket&useUnicode=true&character
Encoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&autoDeserialize=true&autoReconnect=true&maxReconnects=5&autoReconnectForPools=true&jdbcCompliantTruncation=false&netTimeoutForStreamingResults
=1200&useLocalSessionState=true</connection-url>
<driver>mysql</driver>
<security>
   <security-domain>Sec_SWDictionaryDS</security-domain>
</security>
<datasource-class/>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<pool>
   <initial-pool-size>5</initial-pool-size>
   <min-pool-size>5</min-pool-size>
   <max-pool-size>500</max-pool-size>
   <prefill>false</prefill>
   <use-strict-min>false</use-strict-min>
   <flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<timeout>
   <blocking-timeout-millis>7500</blocking-timeout-millis>
   <idle-timeout-minutes>5</idle-timeout-minutes>
   <xa-resource-timeout>0</xa-resource-timeout>
</timeout>
<statement>
   <track-statements>false</track-statements>
   <prepared-statement-cache-size>100</prepared-statement-cache-size>
</statement>
<validation>
   <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
   <use-fast-fail>false</use-fast-fail>
   <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>


JBoss

KBs on versions of

Companyname
prior to release 2019_01 use JBoss instead of Wildfly. You can see examples of such datasource configurations in See examples of datasource configurations in EW_HOME/jboss/server/sw/deploy/ew-ds.xml as as well as as JBoss AS Config DataSources. More detailed information is available in in the Configuring JDBC DataSources document from JBoss AS documentation.

MSSQL Example for MSSQL: 

Code Block
languagesql
<no-tx-datasource>
<jndi-name>DATABASE_NAME</jndi-name>
<min-pool-size>10</min-pool-size>
<max-pool-size>20</max-pool-size>
<blocking-timeout-millis>7500</blocking-timeout-millis>
<idle-timeout-minutes>5</idle-timeout-minutes>
<connection-url>jdbc:sqlserver://SQL_SERVER_HOSTNAME:1433;database=DATABASE_NAME;
SelectMethod=direct;lastupdatecount=true;responseBuffering=adaptive;
lockTimeout=900000;packetSize=512;applicationName=EW</connection-url>
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
<user-name>USER_NAME</user-name>
<password>PASSWORD</password>
<type-mapping>MS SQLSERVER2000</type-mapping>
</no-tx-datasource>
HTML
<p style="page-break-after:always;"></p>

To prevent the datasource file from being overwritten on update, give it a name matching one of the following patterns:

  • *ewcustom*-ds.xml
  • ew_datasource_*-ds.xml
note
Info
titleExample

 ew ew_datasource_my_external_db_ds.xml or myxml or my_db_ewcustom-ds.xml.

Jboss AS picks up the changes to this file immediately, so it is advisable to stop the server process before making changes to this file and start again only after changes are complete.

Hide If
displayprintable

Content by Label
showLabelsfalse
max5
spacesPROD
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("fields","database","linked") and type = "page" and space = currentSpace()
labelslinked fields database