Creating Apache Derby Applications with Python

Using Python Modules

To use a Python module in a Python script, you must tell the Python interpreter to load the module through the import statement. Most Python scripts collect their import statements at the top of the script to ensure that all of the dependencies are met before the rest of the script is run. It is also an easy way to inform other users of your script about the required modules.

All of the Python scripts developed in this chapter start with the following lines:

#!/usr/bin/python
import DB2

When you invoke a script on Windows operating systems from the command line, the first line is ignored. However, on UNIX-based operating systems and in a Web server's CGI handler, the special ...

Get Apache Derby—Off to the Races: Includes Details of IBM® Cloudscape™ now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.