Function documentationconnect Method (sdb.dbapi Module) Locate this document in the navigation structure

 

connect is a method of the sdb.dbapi module for opening database sessions.

Prerequisites

The database is in the ONLINE operational state.

Features

Syntax Syntax

  1. connect (user, password, database, host ='', **config)
End of the code.
connect Method: Attributes

Attribute

Description

user

Name of the database user

password

Password of the database user

Note that the password is case-sensitive.

config

  • autocommit

    on | off

    AUTOCOMMIT mode

  • sqlmode

    internal | oracle

    SQL mode

  • isolation

    0 | 1 | 2 | 3 | 10 | 15 | 20 | 30

    Isolation level

  • timeout

    <integer>

    Command timeout in seconds

Result
  • Successful execution: Object of class sdb.dbapi.Connection

  • If an error occurs: Exception of sdb.dbapi.Error class

For more information, see the Python Database API Specifications V2.0 at http://www.python.org

Example

Syntax Syntax

  1. session = sdb.dbapi.connect ('MONA', 'RED', 'DEMODB', '', autocommit = 'off', sqlmode= 'oracle', isolation = 1, timeout = 90)
End of the code.