Connection URL format
- Last UpdatedJan 04, 2023
- 1 minute read
- PI System
- PI SQL Client JDBC 2021
- Developer
To connect to a database, JDBC uses database URLs. The URL for PI SQL Client JDBC needs to provide the name of the subprotocol, the PI Asset Framework machine name, where PI SQL Data Access Server (RTQP Engine) is installed, and the PI Asset Framework database name. You can specify properties directly in the URL.
This is the format for the connection URL:
jdbc:pisqlclient://<AF Server>[:<Port>]/<AF Database>[;property=value[;property=value]]
Items shown in brackets in the connection URL above are optional. The default port is 5464.
Note: Special characters are not supported in the connection string. If a special character is needed, set the corresponding driver property directly. See Driver properties.
PI SQL Client JDBC provides multiple ways to set properties.
-
JDBC API arguments (user and password)
Overrides the property value if the same property is specified using the URL or configuration file.
The behavior is unpredictable if the same property is specified using the driver properties mechanism.
-
Driver properties
Overrides the property value if the same property is specified using the URL or configuration file.
-
URL
Overrides the property value if the same property is specified using the configuration file.
-
Configuration file
If the same property is specified using any of the other mechanisms listed above, its value will be overwritten.
The following are examples of URLs:
jdbc:pisqlclient://myAFServer:5470/myAFDatabase; Trusted Connection = True; Initial Catalog = myCatalog;
jdbc:pisqlclient://myAFServer/myAFDatabase