## Logging on to a Database Instance

In this example you use the Loader class and the cmd method of the sdb.loader module. You call the Loader and log on to a database instance.

### Procedure

...

1. Create a Python script sample.py with the following contents:

# Import Python modules

# -------------------------------------------

import sys

import sdb.loader

# Call Loader

# -------------------------------------------

session = sdb.loader.Loader ()

# Log on to the database instance

# -------------------------------------------

session.cmd ("USE USER MONA RED DB DEMODB")

# Close connection to the database instance

# -------------------------------------------

session.release ()

2. Call the Python script:

python sample.py

See also:

Examples for the sdb.loader Module