JDBC type data source
A JDBC data source retrieves its data via a JDBC driver, usually type 4 network.
The JDBC connection is available either directly from the ServiceNow instance (a VPN setup required), or via a dedicated MID Server installed inside your firewall that can access the database port.
JDBC data source supported database formats
JDBC data sources support several database formats and ports.
| SQL Server Type | Port |
|---|---|
| MySQL | 3306 |
| Microsoft SQL Server | 1433 |
| Oracle | 1521 |
JDBC data source SQL statement requirements
JDBC queries that run SQL statements must specify a column name.
SELECT DISTINCT 'server_name:' + CONVERT ( VARCHAR , lg .ResourceID ) AS 'ServerID'
,LastHWScan
,Account0
,Category0
Fromv_GS_WORKSTATION_STATUSsInner JOIN
v_GS_LocalGroupMembers0lg
ON s .ResourceID = lg .ResourceID
WhereType0 = 'Local' AND Category0 = 'SystemAccount'
SQL server integrated authentication for Windows
A JDBC data source can use the ID of for the Windows MID Server service user to authenticate with SQL Server.
The Use integrated authentication check box on the Data Source form determines if the JDBC data source uses the MID Server service user credentials. For this field to appear on the Data Source form, the integration must meet these criteria:
- The MID Server must be running on a Windows computer with SQL Server.
- The MID Server service must use the same credentials that SQL Server requires.
- The data source Type is JDBC.
- The data source Use MID Server check box is selected.
- The data source Format is SQLServer.
Adding JDBC drivers for unsupported database formats
Use the following procedure to extend the data source to use a driver for a database that is not provided in the base system. JDBC connections are supported for the following default databases:
Add a new JDBC format choice
Extend the available JDBC driver options by creating a new choice list entry to specify the JDBC driver Java package name.
Before you begin
Role required: import_admin
About this task
Add a new choice list entry for the new database to the Format field in the sys_data_source table.
Procedure
Add Sybase or DB2 JDBC format choices
Extend the available JDBC driver options by activating the Sybase or DB2 choices.
Before you begin
Roles required: admin
About this task
| Format | Driver | Driver class |
|---|---|---|
| Sybase | jconnect-jdbc | com.sybase.jdbc3.jdbc.SybDriver |
| DB2 | db2jcc | com.ibm.db2.jcc.DB2Driver |
If you are using a different implementation of the Sybase or DB2 driver, you must modify the choice Value to use the driver class from your driver implementation.
Procedure
Install a driver on a MID Server
You can install a new JDBC driver JAR file to a MID server to access database formats that are not supported by default.
Before you begin
Role required: agent_admin
Procedure
Create a JDBC data source for an unsupported database format
Add a JDBC data source by defining a data source record.
Before you begin
- Role required: import_admin
- This procedure covers how to create a JDBC data source for an unsupported database format. For general information on creating a JDBC data source, including a detailed description of form fields, see Create a JDBC type data source.
Procedure
Create an import connection alias
Create an import connection alias for the JDBC type data source records.
Before you begin
Role required: import_admin