Configuring the SQL actor adapter


You can use the <configs> tag to help you configure the SQL adapter for multiple targets.

BMC recommends that you do not include unused elements in the adapter configuration because they might cause errors.

Adapter type: ro-adapter-sql-actor[version]

Default adapter name: SQLAdapter

You can define the URL for an SQL query in the following ways:

  • Method one: Define the target, port, subprotocol, database, and any parameter as elements in the configuration, allowing the process to form the URL.

    The following sample is an excerpt from the SQL actor adapter configuration that depicts method one of defining the URL. You need supporting elements to form the complete configuration.

    XML sample of method one for defining a URL


    <target>target1</target>
    <port>port1</port>
    <subprotocol>oracle:thin</subprotocol>
    <database>database1</database>
    <parameters>
     <param1>abc</param1>
     <param2>xyz</param2>
    </parameters>
  • Method two: Define the complete URL, including parameters, in a single element in the configuration.

    The following sample is an excerpt from the SQL actor adapter configuration that depicts method two of defining the URL. You need supporting elements to form the complete configuration.

    XML sample of method two for defining a URL


    <url>jdbc:oracle:thin:@target1:port1:database1?param1=abc&param2=xyz</url>

     
    To configure the SQL actor adapter, see Configuring base adapters.

    The following table describes the SQL actor adapter configuration elements that you can specify by using the form view, XML view, or both. You cannot use the form view to configure elements and attributes that do not have an entry in the "UI label" column.

    The [confluence_table-plus] macro is a standalone macro and it cannot be used inline.

    The following figure shows an XML sample for the SQL actor adapter configuration without a URL.

    XML sample of the SQL actor adapter configuration without a URL


    <configs>
        <config name = "mysql">
           <target>localhost</target>
           <port>3306</port>
           <user-name>root</user-name>
           <password>root123</password>
           <subprotocol>mysql</subprotocol>
           <database>test</database>
           <driver>com.mysql.jdbc.Driver</driver>
        </config>
       <config name = "oracle">
           <target>10.254.1.76</target>
           <port>1521</port>
           <user-name>system</user-name>
           <password>system</password>
           <subprotocol>oracle:thin</subprotocol>
           <database>ORCL</database>
           <driver>oracle.jdbc.driver.OracleDriver</driver>
        </config>
        <config name = "mysql111">
           <target>localhost</target>
           <port>3306</port>
           <user-name>firstuser</user-name>
           <password>firstuser</password>
           <subprotocol>mysql</subprotocol>
           <database>firstuser</database>
           <driver>com.mysql.jdbc.Driver</driver>
        </config>
    </configs>

     
    The following figure shows an XML sample for the SQL actor adapter configuration with a URL.

    XML sample of the SQL actor adapter configuration with a URL


    <configs>
       <config name = "mysql">
           <url>jdbc:mysql://localhost:3306/test</url>
           <user-name>root</user-name>
           <password>root123</password>
           <driver>com.mysql.jdbc.Driver</driver>5
           <max-wait>1200</max-wait>
       </config>
       <config name = "oracle">
           <url>jdbc:oracle:thin:@10.254.1.76:1521:bcas</url>
           <user-name>system</user-name>
           <password>system</password>
           <driver>oracle.jdbc.driver.OracleDriver</driver>
           <max-wait>1200</max-wait>
       </config>
       <config name = "mysql111">
           <url>jdbc:mysql://localhost:3306/firstuser</url>
           <user-name>firstuser</user-name>
           <password>firstuser</password>
           <driver>com.mysql.jdbc.Driver</driver>
           <max-wait>1200</max-wait>
       </config>
    </configs>

The SQL actor adapter supports the following MySql JDBC charsets:

Warning

Note

The SQL actor adapter supports the following databases:

  • MySql (<character-set> element required when configuring the adapter)
  • Sybase (You can append charset=value to the <url> element or include the <charset> element and it's value in the <parameters> element)
  • Oracle (<character-set> element not required when configuring the adapter)
  • Microsoft SQL Server (<character-set> element not required when configuring the adapter)
  • DB2 (<character-set> element not required when configuring the adapter)

    The target database must contain the supporting character set to get the desired results.

The following figure shows an XML sample for the SQL actor adapter configuration with a charset that is supported.

XML sample of the SQL actor adapter configuration with a supported charset


<config>
 <target>localhost</target>
 <port>3306</port>
 <user-name>root</user-name>
 <password>root</password>
 <subprotocol>mysql</subprotocol>
 <database>test</database>
 <driver>com.mysql.jdbc.Driver</driver>
 <character-set>sjis</character-set>
</config>

The following figure shows an XML sample for the SQL actor adapter configuration with a charset that is not supported.

XML sample of the SQL actor adapter configuration with a charset that is not supported


<config>
 <target>localhost</target>
 <port>3306</port>
 <user-name>root</user-name>
 <password>root</password>
 <subprotocol>mysql</subprotocol>
 <database>test</database>
 <driver>com.mysql.jdbc.Driver</driver>
 <parameters>
   <characterEncoding>shift_jis</characterEncoding>
   <useUnicode>true</useUnicode>
 </parameters>
</config>

When the target database is Sybase, the character set must be provided as a parameter or it must be appended to the URL.

The following figure shows an XML sample for the SQL actor adapter configuration when the target database is Sybase.

XML sample of the SQL actor adapter configuration when the target database is Sybase


<config>
 <url>jdbc:sybase:Tds:10.128.249.29:5000/MASTER?charset=sjis</url>
 <user-name>root</user-name>
 <password>root</password>
 <driver></driver>
</config>       or          <config>
  <target>10.128.249.29</target>
 <port>5000</port>
 <user-name>root</user-name>
 <password>root</password>
 <subprotocol>sybase:Tds</subprotocol>
 <database>MASTER</database>
 <driver></driver>
 <parameters>
   <charset>sjis</charset>
 </parameters>
</config>

The following figure shows an XML sample for the SQL actor adapter configuration with Sybase Kerberos Authentication.

XML sample of an SQL actor adapter configuration for Sybase Kerberos Authentication


<config name = "sybasedb">
 <target>10.128.248.105</target>
 <url>jdbc:sybase:Tds:10.128.248.105:5000/MASTER</url>
 <user-name>sa</user-name>
 <password />
 <driver>com.sybase.jdbc3.jdbc.SybDriver</driver>
 <database>master</database>
 <ktgt-cache-file>/tmp/krb5cc_0</ktgt-cache-file>
 <krb-service-principal>REALOPSLINUX1@SYNAPSE.COM</krb-service-principal>
</config>

You can also have an empty configuration, as shown in the following figure.

XML sample of an SQL actor adapter with an empty configuration


<config/>

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

(archive) BMC Atrium Orchestrator Base Adapters 20.12.02