ibm-db 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ibm-db might be problematic. Click here for more details.
- README +155 -0
- config.py +7 -0
- ibm_db.README +1352 -0
- ibm_db.c +7207 -0
- ibm_db.h +284 -0
- ibm_db_dbi.py +832 -0
- setup.py +31 -0
- testfunctions.py +91 -0
- tests/pic1.jpg +0 -0
- tests/spook.png +0 -0
- tests/test_000.py +556 -0
- tests/test_001.py +35 -0
- tests/test_002.py +36 -0
- tests/test_003.py +39 -0
- tests/test_004.py +34 -0
- tests/test_005.py +37 -0
- tests/test_006.py +85 -0
- tests/test_007.py +84 -0
- tests/test_008.py +144 -0
- tests/test_010.py +37 -0
- tests/test_011.py +38 -0
- tests/test_012.py +52 -0
- tests/test_013.py +52 -0
- tests/test_014.py +75 -0
- tests/test_015.py +62 -0
- tests/test_016.py +61 -0
- tests/test_020.py +67 -0
- tests/test_021.py +83 -0
- tests/test_022.py +66 -0
- tests/test_023.py +76 -0
- tests/test_024.py +77 -0
- tests/test_025.py +72 -0
- tests/test_030.py +50 -0
- tests/test_031.py +57 -0
- tests/test_032.py +64 -0
- tests/test_033.py +55 -0
- tests/test_034.py +49 -0
- tests/test_035.py +175 -0
- tests/test_036.py +182 -0
- tests/test_037.py +441 -0
- tests/test_038.py +441 -0
- tests/test_039.py +234 -0
- tests/test_03a.py +58 -0
- tests/test_040.py +67 -0
- tests/test_041.py +76 -0
- tests/test_042.py +59 -0
- tests/test_043.py +184 -0
- tests/test_044.py +203 -0
- tests/test_045.py +40 -0
- tests/test_046.py +68 -0
- tests/test_047.py +73 -0
- tests/test_048.py +45 -0
- tests/test_049.py +61 -0
- tests/test_050.py +33 -0
- tests/test_051.py +35 -0
- tests/test_052.py +35 -0
- tests/test_053.py +141 -0
- tests/test_054.py +61 -0
- tests/test_060.py +94 -0
- tests/test_061.py +100 -0
- tests/test_062.py +96 -0
- tests/test_063.py +36 -0
- tests/test_064.py +102 -0
- tests/test_065.py +93 -0
- tests/test_066.py +187 -0
- tests/test_070.py +43 -0
- tests/test_071.py +43 -0
- tests/test_080.py +38 -0
- tests/test_081.py +39 -0
- tests/test_082.py +34 -0
- tests/test_090.py +34 -0
- tests/test_091.py +34 -0
- tests/test_092.py +34 -0
- tests/test_100.py +78 -0
- tests/test_101.py +56 -0
- tests/test_102.py +39 -0
- tests/test_103.py +82 -0
- tests/test_110.py +92 -0
- tests/test_111.py +99 -0
- tests/test_112.py +63 -0
- tests/test_113.py +76 -0
- tests/test_114.py +63 -0
- tests/test_115.py +79 -0
- tests/test_116.py +89 -0
- tests/test_120.py +87 -0
- tests/test_121.py +96 -0
- tests/test_122.py +83 -0
- tests/test_123.py +13526 -0
- tests/test_124.py +1135 -0
- tests/test_125.py +113 -0
- tests/test_130.py +53 -0
- tests/test_131.py +54 -0
- tests/test_132.py +56 -0
- tests/test_133.py +101 -0
- tests/test_140.py +57 -0
- tests/test_141.py +94 -0
- tests/test_142.py +112 -0
- tests/test_143.py +65 -0
- tests/test_144.py +54 -0
- tests/test_145.py +85 -0
- tests/test_146.py +93 -0
- tests/test_147.py +51 -0
- tests/test_148.py +132 -0
- tests/test_150.py +188 -0
- tests/test_151.py +212 -0
- tests/test_152.py +132 -0
- tests/test_153.py +80 -0
- tests/test_154.py +140 -0
- tests/test_155.py +187 -0
- tests/test_156.py +230 -0
- tests/test_157.py +52 -0
- tests/test_157a.py +63 -0
- tests/test_157b.py +54 -0
- tests/test_158.py +59 -0
- tests/test_159.py +179 -0
- tests/test_159a.py +120 -0
- tests/test_160.py +345 -0
- tests/test_161.py +124 -0
- tests/test_162.py +125 -0
- tests/test_180.py +57 -0
- tests/test_190.py +102 -0
- tests/test_191.py +66 -0
- tests/test_195.py +55 -0
- tests/test_196.py +75 -0
- tests/test_197.py +125 -0
- tests/test_200.py +239 -0
- tests/test_201.py +301 -0
- tests/test_210.py +62 -0
- tests/test_211.py +52 -0
- tests/test_212.py +46 -0
- tests/test_213.py +91 -0
- tests/test_220.py +38 -0
- tests/test_221.py +42 -0
- tests/test_230.py +139 -0
- tests/test_231.py +139 -0
- tests/test_232.py +72 -0
- tests/test_240.py +135 -0
- tests/test_241.py +89 -0
- tests/test_250.py +49 -0
- tests/test_251.py +51 -0
- tests/test_260.py +55 -0
- tests/test_261.py +66 -0
- tests/test_300.py +146 -0
- tests/test_310.py +73 -0
- tests/test_311.py +118 -0
- tests/test_52949.py +109 -0
- tests/test_6528.py +49 -0
- tests/test_6561.py +50 -0
- tests/test_6755.py +63 -0
- tests/test_6792.py +92 -0
- tests.py +56 -0
README
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
Python Driver and DBI Wrapper for IBM Databases
|
|
2
|
+
-----------------------------------------------
|
|
3
|
+
The ibm_db driver and ibm_db_dbi wrapper provide a Python interface for IBM
|
|
4
|
+
databases. The wrapper conforms to the DBI specification located here:
|
|
5
|
+
http://www.python.org/dev/peps/pep-0249/
|
|
6
|
+
|
|
7
|
+
The driver and wrapper have been developed and will be supported by IBM.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Python ibm_db Driver Build and Installation
|
|
11
|
+
-------------------------------------------
|
|
12
|
+
1. Linux
|
|
13
|
+
|
|
14
|
+
Preparations (specific commands dependent on shell):
|
|
15
|
+
If you are compiling against a DB2 instance, do the following
|
|
16
|
+
(paths depend on system):
|
|
17
|
+
. <path_to_sqllib>/db2profile
|
|
18
|
+
export IBM_DB_DIR=<path_to_sqllib>
|
|
19
|
+
export IBM_DB_LIB=<path_to_sqllib>/lib
|
|
20
|
+
|
|
21
|
+
Installation Commands for Linux:
|
|
22
|
+
python setup.py build
|
|
23
|
+
python setup.py install
|
|
24
|
+
|
|
25
|
+
2. Windows
|
|
26
|
+
|
|
27
|
+
Preparations:
|
|
28
|
+
Install Python from:
|
|
29
|
+
http://python.org
|
|
30
|
+
Install Visual C++ 2003, Platform SDK (latest), .NET SDK Version
|
|
31
|
+
1.1 from:
|
|
32
|
+
http://wiki.tcl.tk/11431
|
|
33
|
+
Set envrionment:
|
|
34
|
+
CALL "C:\Program Files\Microsoft Platform SDK for Windows
|
|
35
|
+
Server 2003 R2\SetEnv.Cmd"
|
|
36
|
+
CALL "C:\Program Files\Microsoft Visual C++ Toolkit
|
|
37
|
+
2003\vcvars32.bat"
|
|
38
|
+
SET LIB=%LIB%;C:\Program Files\Microsoft Visual Studio .NET
|
|
39
|
+
2003\Vc7\lib
|
|
40
|
+
(Use notepad to edit config.py to your DB2 settings)
|
|
41
|
+
set IBM_DB_DIR=<path_to_sqllib>
|
|
42
|
+
set IBM_DB_LIB=<path_to_sqllib>\lib
|
|
43
|
+
|
|
44
|
+
Installation Commands for Windows:
|
|
45
|
+
setup.py build
|
|
46
|
+
setup.yp install
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
Python ibm_db_dbi Wrapper Build and Installation
|
|
50
|
+
------------------------------------------------
|
|
51
|
+
There is no special build required to use the ibm_db_wrapper. However, the
|
|
52
|
+
wrapper internally uses the driver. So the driver needs to be built and
|
|
53
|
+
installed before you use the wrapper.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
Setup to use ibm_db or ibm_db_dbi
|
|
57
|
+
---------------------------------
|
|
58
|
+
For Unix based systems:
|
|
59
|
+
Depending on your shell, source the db2profile or db2chsrc. Be sure to source
|
|
60
|
+
the profile for the DB2 instance and not the profile under the DB2 product
|
|
61
|
+
installation. For example:
|
|
62
|
+
. <path_to_sqllib>/db2profile
|
|
63
|
+
or
|
|
64
|
+
source <path_to_sqllib>/db2chsrc
|
|
65
|
+
|
|
66
|
+
Import ibm_db or ibm_db_dbi inside your Python application to use the driver or
|
|
67
|
+
wrapper functionality
|
|
68
|
+
import ibm_db
|
|
69
|
+
or
|
|
70
|
+
import ibm_db_dbi
|
|
71
|
+
|
|
72
|
+
Note: Please make sure that the directory containing the ibm_db_dbi.py file is
|
|
73
|
+
added to the PYTHONPATH variable. This will ensure that the DBI wrapper can be
|
|
74
|
+
accessed in your python applications.
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
List of Operating Systems tested
|
|
78
|
+
--------------------------------
|
|
79
|
+
SuSE Linux Server 9 32 bit
|
|
80
|
+
Ubuntu Linux 7.04 32 bit
|
|
81
|
+
Windows 32 bit
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
Supported Databases
|
|
85
|
+
-------------------
|
|
86
|
+
IBM DB2 Database on Linux, Unix and Windows 8.2 and beyond
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
Future Supported Databases
|
|
90
|
+
--------------------------
|
|
91
|
+
IBM Cloudscape
|
|
92
|
+
Apache Derby
|
|
93
|
+
Remote connections to i5/OS (iSeries)
|
|
94
|
+
Remote connections to z/OS (DB2 UDB for zOS)
|
|
95
|
+
Informix (IDS)
|
|
96
|
+
Native DB2 for i5/OS (iSeries)
|
|
97
|
+
Native DB2 UDB for zOS
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
Testing
|
|
101
|
+
-------
|
|
102
|
+
Tests displaying Python ibm_db driver code examples are located in the tests
|
|
103
|
+
directory. These tests can be run by using 'python tests.py' on Unix based
|
|
104
|
+
systems, and 'tests.py' on Windows based systems. Use vi to edit config.py to
|
|
105
|
+
your DB2 settings.
|
|
106
|
+
|
|
107
|
+
The tests that ibm_db driver uses depends on a UTF-8 database. This can be
|
|
108
|
+
created by running:
|
|
109
|
+
CREATE DATABASE mydatabase USING CODESET UTF-8 TERRITORY US
|
|
110
|
+
Some of the tests utilize XML functionality only available in version 9 or
|
|
111
|
+
later of DB2. While DB2 v8.x is fully supported, two of the tests
|
|
112
|
+
(test_195.py and test_52949.py) utilize XML functionality. These tests will
|
|
113
|
+
fail on version 8.x of DB2.
|
|
114
|
+
|
|
115
|
+
Running the driver testsuite on Linux
|
|
116
|
+
In order to run the entire python driver testsuite on Linux, run this
|
|
117
|
+
command at the command prompt:
|
|
118
|
+
python tests.py
|
|
119
|
+
To run a single test, set the environment variable, SINGLE_PYTHON_TEST, to
|
|
120
|
+
the test filename you would like to run, followed by the previous command.
|
|
121
|
+
|
|
122
|
+
Running the driver testsuite on Windows
|
|
123
|
+
In order to run the entire python driver testsuite on Windows, run this
|
|
124
|
+
command at the command prompt:
|
|
125
|
+
tests.py
|
|
126
|
+
To run a single test, set the environment variable, SINGLE_PYTHON_TEST, to
|
|
127
|
+
the test filename you would like to run, followed by the previous command.
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
Known Limitations for the Python driver
|
|
131
|
+
---------------------------------------
|
|
132
|
+
1. The following tests are expected to fail:
|
|
133
|
+
test_03a.py:
|
|
134
|
+
Fails due to an exception being thrown by the driver and not
|
|
135
|
+
being caught by the test.
|
|
136
|
+
test_133.py:
|
|
137
|
+
Fails due to the None object not being returned by the
|
|
138
|
+
ibm_db.execute() statement on line 48.
|
|
139
|
+
test_146.py:
|
|
140
|
+
Fails due to issues with procedures being called with
|
|
141
|
+
parameters that have a parameter-type of SQL_PARAM_OUTPUT.
|
|
142
|
+
test_148.py:
|
|
143
|
+
Same issue as test_146.py.
|
|
144
|
+
tests_53494.py:
|
|
145
|
+
Same issue as test_52949.py.
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
Known Limitations for the Python wrapper
|
|
149
|
+
----------------------------------------
|
|
150
|
+
1. An error is thrown when selecting a row which has a BLOB type
|
|
151
|
+
column with a null value.
|
|
152
|
+
2. The rowcount for complex select statements can not be generated.
|
|
153
|
+
The wrapper might throw errors with complex select statement.
|
|
154
|
+
3. Some warnings from the drivers are not caught by the wrapper.
|
|
155
|
+
As such these might go unnoticed.
|
config.py
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
test_dir = 'tests' # Location of testsuite file (relative to current directory)
|
|
2
|
+
|
|
3
|
+
database = 'sample' # Database to connect to
|
|
4
|
+
user = 'db2inst1' # User ID to connect with
|
|
5
|
+
password = 'password' # Password for given User ID
|
|
6
|
+
hostname = 'localhost' # Hostname
|
|
7
|
+
port = 60000 # Port Number
|