Registering server definitions for JDBC data sources
You must register each JDBC server that you want to access in the federated database.
For Db2® v11.5.7 or earlier, to register the JDBC server, you must specify the JDBC driver package name from the JDBC driver library and the JDBC connection string of the remote server. As of Db2 v11.5.8, JDBC wrapper need not be created explicitly, and only the URL must be specified. Also, the DRIVER_PACKAGE and DRIVER_CLASS are not required for the JDBC data sources with the driver library bundled in Db2 installation. You can check for the new configuration file
About this task
jdbc.iniin all the bundled JDBC data sources. For those data sources that are not bundled with the driver library, you can download the JDBC driver from the vendor and specify the DRIVER_PACKAGE and DRIVER_CLASS.
Run the CREATE SERVER statement from the command line for every JDBC server that you want to register,
-- New simplifed syntax CREATE SERVER server_Definition_Name TYPE jdbc_Datasource_Type VERSION version_Number OPTIONS ( URL ‘jdbc_Url_Connect_String');
-- Old traditional syntax CREATE SERVER server_Definition_Name TYPE jdbc_Datasource_Type VERSION version_Number WRAPPER jdbc_Wrapper_Name OPTIONS ( DRIVER_PACKAGE 'jdbc_Driver_package_optional', DRIVER_CLASS ‘jdbc_Driver_Class_Path', URL ‘jdbc_Url_Connect_String');
Important: When you run the CREATE SERVER statement, it does not create a connection to data source until you run the CREATE NICKNAME statement. If you specify incorrect connection information in the OPTIONS parameter, you are not notified of the error until you run either the CREATE NICKNAME or pass-through statements.
After you complete this task, you must create a user mapping.