Contents
Strategic Partner Links
Sepasoft - MES Modules
Cirrus Link - MQTT Modules
Resources
Knowledge Base Articles
Inductive University
Forum
IA Support
SDK Documentation
SDK Examples
Adds a new database connection in Ignition.
Permission Type: Datasource Management
Client access to this scripting function is blocked to users that do not meet the role/zone requirements for the above permission type. This function is unaffected when run in the Gateway scope.
system.db.addDatasource(jdbcDriver, name, description, connectUrl, username, password, props, validationQuery, maxConnections)
String jdbcDriver - The name of the JDBC driver in Ignition. Required.
String name - The datasource name. Required.
String description - Description of the datasource
String connectUrl - Default is the connect URL for JDBC driver.
String username - Username to login to the datasource with.
String password - Password for the login.
String props - The extra connection parameters.
String validationQuery - Default is the validation query for the JDBC driver.
Integer maxConnections - Default is 8.
Nothing
All
# The following code would add a MySQL connection to the Gateway. system.db.addDatasource(jdbcDriver="MySQL ConnectorJ", name="MySQL", connectURL="jdbc:mysql://localhost:3306/test", username="root", password="password", props="zeroDateTimeBehavior=convertToNull;")