Search code examples
sql-serverdatasourcejboss-eap-6xa

How to specify SQL Server database instance name on XA datasource in JBoss EAP 6?


Connection properties for XA datasources in JBoss EAP 6 are configured in XA properties tab, e.g. using the ServerName, DatabaseName and PortNumber properties. How to specify the SQL Server database instance name I want the data source to connect to?

In jtds I use the pattern: jdbc:jtds:sqlserver://@ServerName/@DatabaseName;instance=@InstanceName


Solution

  • Apparently the @InstanceName should be specified as a part of @ServerName, as follows:

    @ServerName\\@InstanceName

    Note the double backslash is necessary while using the Admin Console Add dialog (Properties tab) - it will be automatically converted to single backslash. If a single backslash is entered, it is not possible to add the property at all (there is no warning/error message showed though).