DatabaseLink`
DatabaseLink`

SQLConnectionPool

SQLConnectionPool[]

is an object that represents a connection pool to a data source.

Details and Options

  • To use SQLConnectionPool, you first need to load DatabaseLink using Needs["DatabaseLink`"].
  • SQLConnectionPools returns an SQLConnectionPool object.
  • The following options can be modified in an SQLConnectionPool object:
  • "Catalog"Automaticlocation of the database catalog
    "ReadOnly"Automaticset the connection to be read only
    "TransactionIsolationLevel"Automaticset transaction isolation for the connection
    "MaximumActiveConnections"Automaticmaximum number of connections to keep in the pool
    "MaximumIdleConnections"Automaticmaximum number of idle connections to keep in the pool
    "MinimumIdleConnections"Automaticminimum number of idle connections to keep in the pool

Examples

Basic Examples  (1)

If you find that the examples in this section do not work as shown, you may need to install or restore the example database with the "DatabaseLink`DatabaseExamples`" package, as described in Using the Example Databases.

Open a connection:

The connection pool used to connect to the data source:

Set an option dynamically on the pool:

Close the pool and associated connections: