The Perl DBI module is a simple Perl database interface used to execute queries. The Perl DBI module executes a query through an appropriate database driver (DBD) module.
A DBD module has the required libraries needed to communicate to a database. When you use the Perl DBI module to make a query, it sends the query to the corresponding DBD module to communicate directly to the database.
With the EC-DBI plugin, you can:
- Execute SQL scripts from SQL files or from the text area in the parameter form.
- Create backups for your databases.
The plugin executes the SQL code against databases by using the Perl DBI module, which means that you must install the corresponding DBD module. DBD-mysql and DBD-ODBC are installed by default, which means that you can access MYSQL and SQL Server or any preconfigured ODBC connection by default. Additional DBD Modules are required for Oracle, Postgres, and SQLite. Additionally, it can back up databases by calling command-line tools for almost every database type. For example, MySQL uses mysqldump
, SQL Server uses osql
, Oracle uses exp
, and Postgres usespg_dump
.
This plugin can communicate with the following databases:
- SQL Server (through ODBC) 2008
- MySQL 5.5
- Oracle 9.2 or later
- SQLite 3.7.7
- Postgres 8.4 or later
More information can be found in the Perl DBI documentation.
Perl DBD modules can be found in the CPAN documentation.
For all parameter descriptions below, required parameters are shown in bold italics.
Plugin configurations are sets of parameters that can be applied across some, or all, of the plugin procedures. They can reduce the repetition of common values, create predefined parameter sets, and securely store credentials. Each configuration is given a unique name that is entered in the designated parameter for the plugin procedures that use them.
Parameter | Description |
---|---|
Configuration Name |
Provide a unique name for the configuration. (Required) |
User Name |
Provide the user login ID for your database connection. (Required) |
Password |
Provide the user-specified password. (Required) |
This procedure creates a database connection through the Perl DBI module and a Perl DBD module to execute an SQL statement against the corresponding database.
You can access any database indirectly by using a preconfigured ODBC.
Additional Perl modules are required for the following databases:
Database | Module name | CPAN reference |
---|---|---|
Oracle |
DBD-Oracle |
|
SQLite |
DBD-SQLite |
|
Postgres |
DBD-Pg |
Parameter | Description |
---|---|
Database engine |
Choose the database engine you want to connect to. Available options are: SQLServer, MySql, Oracle, Sqlite, Postgres, or an ODBC connection to any database. (Required) |
Database name |
The name of the database you want to use. (Required) |
Server |
Database server name. (Required) |
Port |
Database port. Common default ports are:
|
Enable transactions |
If checked, this option protects your data in case of errors. |
Display format |
Choose a display format. (Required) |
Sql query |
The query to run against the database. |
Sql file |
Absolute path to a SQL script. |
Configuration name |
Name of the configuration that contains the database user and password. (Required) |
Result (output property path) |
Property name used to store the result of queries. |
Creates a backup for the specified database.
Parameter | Description |
---|---|
Database engine |
Choose the database engine you want to connect to. Available options are: SQLServer, MySql, Oracle, Postgres and Sqlite. (Required) |
Command Line Utility |
Absolute path to a backup command utility. (Required):
|
Database name |
The name of the database to back up. (Required) |
Server |
Database server name. |
Port |
Database port. Some of the default ports are:
|
Configuration name |
Name of the configuration that contains the database user and password. (Required) |
Name of the backup file |
Name of the backup file (without extension). If you leave the field blank, the file name is "backup". |
Destination path |
The path where you want to store your backup file. (Required) |
The following example shows how to create a configuration:
The following example shows a list of server configurations:
The following example shows a completed ExecuteQuery parameter form:
The following example shows output for ExecuteQuery:
The following example shows a completed MySql backup parameter form:
The following example shows output for a MySQL backup:
The following example shows a completed Oracle backup parameter form:
The following example shows output for an Oracle backup:
The following example shows a completed SQL Server backup parameter form:
The following example shows output for a SQL Server backup:
- The documentation has been migrated to the main documentation site.
- Added metadata that is required for 9.0 release.
- Fixed issue with configurations being cached for Internet Explorer®.
- ElectricCommander was renamed to CloudBees.
-
The result (output property path) parameter was added.
-
JSON and XML formats for results were added.
- Procedure names were changed in the step picker section.
-
XML parameter panels were added.
-
The Help page was updated.
- Initial release.