Execute SQL Query on a JDBC-Compatible Database

DESCRIPTION:

Executes an SQL command on a JDBC-Compatible database.

USAGE:

executeJDBC(sqlQuery, driverClass, con, user, password, keepAlive)

ARGUMENTS:

sqlQuery
The SQL query to execute.
driverClass
The name of the Java class for required JDBC driver.
con
The JDBC connection string.
user
The user name with access to database.
password
The password for the given user name on the database.
keepAlive
If TRUE, keeps the database connection alive after executing the query. The default is FALSE.

DETAILS:

Executes the command on the database using the JDBC driver specified in driverClass. The necessary JDBC driver must be loaded in sjdbc before use. See for details.

Database connections are closed by default after executing the query, unless keepAlive is set to TRUE. If keepAlive = TRUE, the connection remains open, and successive database commands can reuse the open connection if and only if the same values for driverClass, con, user, and password are supplied.

VALUE:

The number of rows affected, if applicable.

NOTE:

Some arguments can also be set using .

EXAMPLES:

## Not run: 
executeJDBC(driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver", 
            con="jdbc:sqlserver://qadb-s2k:1433;databaseName=testdb;user=testqa;password=testqa;", 
            user="testqa", password="testqa",
            sqlQuery="UPDATE TEST1 SET Weight = NULL WHERE Weight < 2500")

executeJDBC(driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver", 
            con="jdbc:sqlserver://qadb-s2k:1433;databaseName=testdb;user=testqa;password=testqa;", 
            user="testqa", password="testqa",
            sqlQuery="DROP TABLE TEST1")
## End(Not run)