ibruby 0.5.0-i586-linux

Sign up to get free protection for your applications and to get access to all the features.
data/doc/license.txt ADDED
@@ -0,0 +1,411 @@
1
+ Mozilla Public License 1.1 (MPL 1.1)
2
+
3
+ 1. Definitions.
4
+
5
+ 1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code
6
+ available to a third party.
7
+
8
+ 1.1. ''Contributor'' means each entity that creates or contributes to the
9
+ creation of Modifications.
10
+
11
+ 1.2. ''Contributor Version'' means the combination of the Original Code, prior
12
+ Modifications used by a Contributor, and the Modifications made by that
13
+ particular Contributor.
14
+
15
+ 1.3. ''Covered Code'' means the Original Code or Modifications or the
16
+ combination of the Original Code and Modifications, in each case including
17
+ portions thereof.
18
+
19
+ 1.4. ''Electronic Distribution Mechanism'' means a mechanism generally accepted
20
+ in the software development community for the electronic transfer of data.
21
+
22
+ 1.5. ''Executable'' means Covered Code in any form other than Source Code.
23
+
24
+ 1.6. ''Initial Developer'' means the individual or entity identified as the
25
+ Initial Developer in the Source Code notice required by Exhibit A.
26
+
27
+ 1.7. ''Larger Work'' means a work which combines Covered Code or portions
28
+ thereof with code not governed by the terms of this License.
29
+
30
+ 1.8. ''License'' means this document.
31
+
32
+ 1.8.1. "Licensable" means having the right to grant, to the maximum extent
33
+ possible, whether at the time of the initial grant or subsequently
34
+ acquired, any and all of the rights conveyed herein.
35
+
36
+ 1.9. ''Modifications'' means any addition to or deletion from the substance or
37
+ structure of either the Original Code or any previous Modifications. When
38
+ Covered Code is released as a series of files, a Modification is:
39
+
40
+ A. Any addition to or deletion from the contents of a file containing
41
+ Original Code or previous Modifications.
42
+
43
+ B. Any new file that contains any part of the Original Code or previous
44
+ Modifications.
45
+
46
+ 1.10. ''Original Code'' means Source Code of computer software code which is
47
+ described in the Source Code notice required by Exhibit A as Original
48
+ Code, and which, at the time of its release under this License is not
49
+ already Covered Code governed by this License.
50
+
51
+ 1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter
52
+ acquired, including without limitation,� method, process, and apparatus
53
+ claims, in any patent Licensable by grantor.
54
+
55
+ 1.11. ''Source Code'' means the preferred form of the Covered Code for making
56
+ modifications to it, including all modules it contains, plus any
57
+ associated interface definition files, scripts used to control compilation
58
+ and installation of an Executable, or source code differential comparisons
59
+ against either the Original Code or another well known, available Covered
60
+ Code of the Contributor's choice. The Source Code can be in a compressed
61
+ or archival form, provided the appropriate decompression or de-archiving
62
+ software is widely available for no charge.
63
+
64
+ 1.12. "You'' (or "Your")� means an individual or a legal entity exercising
65
+ rights under, and complying with all of the terms of, this License or a
66
+ future version of this License issued under Section 6.1. For legal
67
+ entities, "You'' includes any entity which controls, is controlled by, or
68
+ is under common control with You. For purposes of this definition,
69
+ "control'' means (a) the power, direct or indirect, to cause the direction
70
+ or management of such entity, whether by contract or otherwise, or (b)
71
+ ownership of more than fifty percent (50%) of the outstanding shares or
72
+ beneficial ownership of such entity.
73
+
74
+ 2. Source Code License.
75
+
76
+ 2.1. The Initial Developer Grant.
77
+ The Initial Developer hereby grants You a world-wide, royalty-free,
78
+ non-exclusive license, subject to third party intellectual property claims:
79
+
80
+ (a)� under intellectual property rights (other than patent or trademark)
81
+ Licensable by Initial Developer to use, reproduce, modify, display,
82
+ perform, sublicense and distribute the Original Code (or portions
83
+ thereof) with or without Modifications, and/or as part of a Larger Work;
84
+ and
85
+
86
+ (b) under Patents Claims infringed by the making, using or selling of
87
+ Original Code, to make, have made, use, practice, sell, and offer for
88
+ sale, and/or otherwise dispose of the Original Code (or portions
89
+ thereof).
90
+
91
+ (c) the licenses granted in this Section 2.1(a) and (b) are effective on the
92
+ date Initial Developer first distributes Original Code under the terms
93
+ of this License.
94
+
95
+ (d) Notwithstanding Section 2.1(b) above, no patent license is granted:
96
+ 1) for code that You delete from the Original Code; 2) separate from the
97
+ Original Code;� or 3) for infringements caused by: i) the modification
98
+ of the Original Code or ii) the combination of the Original Code with
99
+ other software or devices.
100
+
101
+ 2.2. Contributor Grant.
102
+ Subject to third party intellectual property claims, each Contributor hereby
103
+ grants You a world-wide, royalty-free, non-exclusive license
104
+
105
+ (a)� under intellectual property rights (other than patent or trademark)
106
+ Licensable by Contributor, to use, reproduce, modify, display, perform,
107
+ sublicense and distribute the Modifications created by such Contributor
108
+ (or portions thereof) either on an unmodified basis, with other
109
+ Modifications, as Covered Code and/or as part of a Larger Work; and
110
+
111
+ (b) under Patent Claims infringed by the making, using, or selling of
112
+ � Modifications made by that Contributor either alone and/or in
113
+ combination with its Contributor Version (or portions of such
114
+ combination), to make, use, sell, offer for sale, have made, and/or
115
+ otherwise dispose of: 1) Modifications made by that Contributor (or
116
+ portions thereof); and 2) the combination of� Modifications made by that
117
+ Contributor with its Contributor Version (or portions of such
118
+ combination).
119
+
120
+ (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the
121
+ date Contributor first makes Commercial Use of the Covered Code.
122
+
123
+ (d)� Notwithstanding Section 2.2(b) above, no patent license is granted:
124
+ 1) for any code that Contributor has deleted from the Contributor
125
+ Version; 2)� separate from the Contributor Version;� 3)� for
126
+ infringements caused by: i) third party modifications of Contributor
127
+ Version or ii)� the combination of Modifications made by that
128
+ Contributor with other software� (except as part of the Contributor
129
+ Version) or other devices; or 4) under Patent Claims infringed by
130
+ Covered Code in the absence of Modifications made by that Contributor.
131
+
132
+ 3. Distribution Obligations.
133
+
134
+ 3.1. Application of License.
135
+ The Modifications which You create or to which You contribute are governed by
136
+ the terms of this License, including without limitation Section 2.2. The Source
137
+ Code version of Covered Code may be distributed only under the terms of this
138
+ License or a future version of this License released under Section 6.1, and You
139
+ must include a copy of this License with every copy of the Source Code You
140
+ distribute. You may not offer or impose any terms on any Source Code version
141
+ that alters or restricts the applicable version of this License or the
142
+ recipients' rights hereunder. However, You may include an additional document
143
+ offering the additional rights described in Section 3.5.
144
+
145
+ 3.2. Availability of Source Code.
146
+ Any Modification which You create or to which You contribute must be made
147
+ available in Source Code form under the terms of this License either on the same
148
+ media as an Executable version or via an accepted Electronic Distribution
149
+ Mechanism to anyone to whom you made an Executable version available; and if
150
+ made available via Electronic Distribution Mechanism, must remain available for
151
+ at least twelve (12) months after the date it initially became available, or at
152
+ least six (6) months after a subsequent version of that particular Modification
153
+ has been made available to such recipients. You are responsible for ensuring
154
+ that the Source Code version remains available even if the Electronic
155
+ Distribution Mechanism is maintained by a third party.
156
+
157
+ 3.3. Description of Modifications.
158
+ You must cause all Covered Code to which You contribute to contain a file
159
+ documenting the changes You made to create that Covered Code and the date of any
160
+ change. You must include a prominent statement that the Modification is derived,
161
+ directly or indirectly, from Original Code provided by the Initial Developer and
162
+ including the name of the Initial Developer in (a) the Source Code, and (b) in
163
+ any notice in an Executable version or related documentation in which You
164
+ describe the origin or ownership of the Covered Code.
165
+
166
+ 3.4. Intellectual Property Matters
167
+ (a) Third Party Claims.
168
+ If Contributor has knowledge that a license under a third party's
169
+ intellectual property rights is required to exercise the rights granted by
170
+ such Contributor under Sections 2.1 or 2.2, Contributor must include a text
171
+ file with the Source Code distribution titled "LEGAL'' which describes the
172
+ claim and the party making the claim in sufficient detail that a recipient
173
+ will know whom to contact. If Contributor obtains such knowledge after the
174
+ Modification is made available as described in Section 3.2, Contributor shall
175
+ promptly modify the LEGAL file in all copies Contributor makes available
176
+ thereafter and shall take other steps (such as notifying appropriate mailing
177
+ lists or newsgroups) reasonably calculated to inform those who received the
178
+ Covered Code that new knowledge has been obtained.
179
+
180
+ (b) Contributor APIs.
181
+ If Contributor's Modifications include an application programming interface
182
+ and Contributor has knowledge of patent licenses which are reasonably
183
+ necessary to implement that API, Contributor must also include this
184
+ information in the LEGAL file.
185
+
186
+ ���(c)��� Representations.
187
+ Contributor represents that, except as disclosed pursuant to Section 3.4(a)
188
+ above, Contributor believes that Contributor's Modifications are
189
+ Contributor's original creation(s) and/or Contributor has sufficient rights
190
+ to grant the rights conveyed by this License.
191
+
192
+ 3.5. Required Notices.
193
+ You must duplicate the notice in Exhibit A in each file of the Source Code.� If
194
+ it is not possible to put such notice in a particular Source Code file due to
195
+ its structure, then You must include such notice in a location (such as a
196
+ relevant directory) where a user would be likely to look for such a notice.� If
197
+ You created one or more Modification(s) You may add your name as a Contributor
198
+ to the notice described in Exhibit A.� You must also duplicate this License in
199
+ any documentation for the Source Code where You describe recipients' rights or
200
+ ownership rights relating to Covered Code.� You may choose to offer, and to
201
+ charge a fee for, warranty, support, indemnity or liability obligations to one
202
+ or more recipients of Covered Code. However, You may do so only on Your own
203
+ behalf, and not on behalf of the Initial Developer or any Contributor. You must
204
+ make it absolutely clear than any such warranty, support, indemnity or liability
205
+ obligation is offered by You alone, and You hereby agree to indemnify the
206
+ Initial Developer and every Contributor for any liability incurred by the
207
+ Initial Developer or such Contributor as a result of warranty, support,
208
+ indemnity or liability terms You offer.
209
+
210
+ 3.6. Distribution of Executable Versions.
211
+ You may distribute Covered Code in Executable form only if the requirements of
212
+ Section 3.1-3.5 have been met for that Covered Code, and if You include a notice
213
+ stating that the Source Code version of the Covered Code is available under the
214
+ terms of this License, including a description of how and where You have
215
+ fulfilled the obligations of Section 3.2. The notice must be conspicuously
216
+ included in any notice in an Executable version, related documentation or
217
+ collateral in which You describe recipients' rights relating to the Covered
218
+ Code. You may distribute the Executable version of Covered Code or ownership
219
+ rights under a license of Your choice, which may contain terms different from
220
+ this License, provided that You are in compliance with the terms of this License
221
+ and that the license for the Executable version does not attempt to limit or
222
+ alter the recipient's rights in the Source Code version from the rights set
223
+ forth in this License. If You distribute the Executable version under a
224
+ different license You must make it absolutely clear that any terms which differ
225
+ from this License are offered by You alone, not by the Initial Developer or any
226
+ Contributor. You hereby agree to indemnify the Initial Developer and every
227
+ Contributor for any liability incurred by the Initial Developer or such
228
+ Contributor as a result of any such terms You offer.
229
+
230
+ 3.7. Larger Works.
231
+ You may create a Larger Work by combining Covered Code with other code not
232
+ governed by the terms of this License and distribute the Larger Work as a single
233
+ product. In such a case, You must make sure the requirements of this License are
234
+ fulfilled for the Covered Code.
235
+
236
+ 4. Inability to Comply Due to Statute or Regulation.
237
+
238
+ If it is impossible for You to comply with any of the terms of this License with
239
+ respect to some or all of the Covered Code due to statute, judicial order, or
240
+ regulation then You must: (a) comply with the terms of this License to the
241
+ maximum extent possible; and (b) describe the limitations and the code they
242
+ affect. Such description must be included in the LEGAL file described in Section
243
+ 3.4 and must be included with all distributions of the Source Code. Except to
244
+ the extent prohibited by statute or regulation, such description must be
245
+ sufficiently detailed for a recipient of ordinary skill to be able to understand
246
+ it.
247
+
248
+ 5. Application of this License.
249
+
250
+ This License applies to code to which the Initial Developer has attached the
251
+ notice in Exhibit A and to related Covered Code.
252
+
253
+ 6. Versions of the License.
254
+
255
+ 6.1. New Versions.
256
+ Netscape Communications Corporation (''Netscape'') may publish revised and/or
257
+ new versions of the License from time to time. Each version will be given a
258
+ distinguishing version number.
259
+
260
+ 6.2. Effect of New Versions.
261
+ Once Covered Code has been published under a particular version of the License,
262
+ You may always continue to use it under the terms of that version. You may also
263
+ choose to use such Covered Code under the terms of any subsequent version of the
264
+ License published by Netscape. No one other than Netscape has the right to
265
+ modify the terms applicable to Covered Code created under this License.
266
+
267
+ 6.3. Derivative Works.
268
+ If You create or use a modified version of this License (which you may only do
269
+ in order to apply it to code which is not already Covered Code governed by this
270
+ License), You must (a) rename Your license so that the phrases ''Mozilla'', ''MOZILLAPL'', ''MOZPL'', ''Netscape'', "MPL", ''NPL'' or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
271
+
272
+ 7. DISCLAIMER OF WARRANTY.
273
+
274
+ COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT
275
+ WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
276
+ LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE,
277
+ FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE
278
+ QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE
279
+ PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER
280
+ CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION.
281
+ THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO
282
+ USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
283
+
284
+ 8. TERMINATION.
285
+
286
+ 8.1.� This License and the rights granted hereunder will terminate automatically
287
+ if You fail to comply with terms herein and fail to cure such breach within 30
288
+ days of becoming aware of the breach. All sublicenses to the Covered Code which
289
+ are properly granted shall survive any termination of this License. Provisions
290
+ which, by their nature, must remain in effect beyond the termination of this
291
+ License shall survive.
292
+
293
+ 8.2.� If You initiate litigation by asserting a patent infringement claim
294
+ (excluding declatory judgment actions) against Initial Developer or a
295
+ Contributor (the Initial Developer or Contributor against whom You file such
296
+ action is referred to as "Participant")� alleging that:
297
+
298
+ (a)� such Participant's Contributor Version directly or indirectly infringes
299
+ any patent, then any and all rights granted by such Participant to You under
300
+ Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from
301
+ Participant terminate prospectively, unless if within 60 days after receipt
302
+ of notice You either: (i)� agree in writing to pay Participant a mutually
303
+ agreeable reasonable royalty for Your past and future use of Modifications
304
+ made by such Participant, or (ii) withdraw Your litigation claim with respect
305
+ to the Contributor Version against such Participant.� If within 60 days of
306
+ notice, a reasonable royalty and payment arrangement are not mutually agreed
307
+ upon in writing by the parties or the litigation claim is not withdrawn, the
308
+ rights granted by Participant to You under Sections 2.1 and/or 2.2
309
+ automatically terminate at the expiration of the 60 day notice period
310
+ specified above.
311
+
312
+ (b)� any software, hardware, or device, other than such Participant's
313
+ Contributor Version, directly or indirectly infringes any patent, then any
314
+ rights granted to You by such Participant under Sections 2.1(b) and 2.2(b)
315
+ are revoked effective as of the date You first made, used, sold, distributed,
316
+ or had made, Modifications made by that Participant.
317
+
318
+ 8.3.� If You assert a patent infringement claim against Participant alleging
319
+ that such Participant's Contributor Version directly or indirectly infringes any
320
+ patent where such claim is resolved (such as by license or settlement) prior to
321
+ the initiation of patent infringement litigation, then the reasonable value of
322
+ the licenses granted by such Participant under Sections 2.1 or 2.2 shall be
323
+ taken into account in determining the amount or value of any payment or license.
324
+
325
+ 8.4.� In the event of termination under Sections 8.1 or 8.2 above,� all end user
326
+ license agreements (excluding distributors and resellers) which have been
327
+ validly granted by You or any distributor hereunder prior to termination shall
328
+ survive termination.
329
+
330
+ 9. LIMITATION OF LIABILITY.
331
+
332
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
333
+ NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER
334
+ CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH
335
+ PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
336
+ CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES
337
+ FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND
338
+ ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
339
+ INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL
340
+ NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S
341
+ NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME
342
+ JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR
343
+ CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
344
+
345
+ 10. U.S. GOVERNMENT END USERS.
346
+
347
+ The Covered Code is a ''commercial item,'' as that term is defined in 48 C.F.R.
348
+ 2.101 (Oct. 1995), consisting of ''commercial computer software'' and
349
+ ''commercial computer software documentation,'' as such terms are used in 48
350
+ C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R.
351
+ 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire
352
+ Covered Code with only those rights set forth herein.
353
+
354
+ 11. MISCELLANEOUS.
355
+
356
+ This License represents the complete agreement concerning subject matter hereof.
357
+ If any provision of this License is held to be unenforceable, such provision
358
+ shall be reformed only to the extent necessary to make it enforceable. This
359
+ License shall be governed by California law provisions (except to the extent
360
+ applicable law, if any, provides otherwise), excluding its conflict-of-law
361
+ provisions. With respect to disputes in which at least one party is a citizen
362
+ of, or an entity chartered or registered to do business in the United States of
363
+ America, any litigation relating to this License shall be subject to the
364
+ jurisdiction of the Federal Courts of the Northern District of California, with
365
+ venue lying in Santa Clara County, California, with the losing party responsible
366
+ for costs, including without limitation, court costs and reasonable attorneys'
367
+ fees and expenses. The application of the United Nations Convention on Contracts
368
+ for the International Sale of Goods is expressly excluded. Any law or regulation
369
+ which provides that the language of a contract shall be construed against the
370
+ drafter shall not apply to this License.
371
+
372
+ 12. RESPONSIBILITY FOR CLAIMS.
373
+
374
+ As between Initial Developer and the Contributors, each party is responsible
375
+ for claims and damages arising, directly or indirectly, out of its utilization
376
+ of rights under this License and You agree to work with Initial Developer and
377
+ Contributors to distribute such responsibility on an equitable basis. Nothing
378
+ herein is intended or shall be deemed to constitute any admission of liability.
379
+
380
+ 13. MULTIPLE-LICENSED CODE.
381
+
382
+ Initial Developer may designate portions of the Covered Code as
383
+ Multiple-Licensed.� Multiple-Licensed means that the Initial Developer permits
384
+ you to utilize portions of the Covered Code under Your choice of the NPL or the
385
+ alternative licenses, if any, specified by the Initial Developer in the file
386
+ described in Exhibit A.
387
+
388
+
389
+ EXHIBIT A -Mozilla Public License.
390
+ ``The contents of this file are subject to the Mozilla Public License Version
391
+ 1.1 (the "License"); you may not use this file except in compliance with the
392
+ License. You may obtain a copy of the License at
393
+
394
+ http://www.mozilla.org/MPL/
395
+
396
+ Software distributed under the License is distributed on an "AS IS" basis,
397
+ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
398
+ the specificlanguage governing rights and limitations under the License.
399
+
400
+ The Original Code is the FireRuby extension for the Ruby language.
401
+
402
+ The Initial Developer of the Original Code is Peter Wood. Portions created by
403
+ �______________________ are Copyright (C) ______ _______________________.
404
+ All Rights Reserved.
405
+
406
+ Contributor(s): ______________________________________.
407
+
408
+ [NOTE: The text of this Exhibit A may differ slightly from the text of the
409
+ notices in the Source Code files of the Original Code. You should use the text
410
+ of this Exhibit A rather than the text found in the Original Code Source Code
411
+ for Your Modifications.]
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require_gem 'ibruby'
5
+
6
+ include IBRuby
7
+
8
+ # Database details constants.
9
+ DB_FILE = "localhost:#{File.expand_path('.')}#{File::SEPARATOR}example.ib"
10
+ DB_USER_NAME = "sysdba"
11
+ DB_PASSWORD = "masterkey"
12
+
13
+ # SQL constants.
14
+ CREATE_TABLE_SQL = 'CREATE TABLE TESTTABLE (TESTID INTEGER NOT NULL PRIMARY '\
15
+ 'KEY, TESTTEXT VARCHAR(100), TESTFLOAT NUMERIC(6,2), '\
16
+ 'CREATED TIMESTAMP)'
17
+ DROP_TABLE_SQL = 'DROP TABLE TESTTABLE'
18
+ INSERT_SQL = 'INSERT INTO TESTTABLE VALUES(?, ?, ?, ?)'
19
+ SELECT_SQL = 'SELECT * FROM TESTTABLE'
20
+
21
+ begin
22
+ # Check if the database file exists.
23
+ db = nil
24
+ if File.exist?(DB_FILE) == false
25
+ # Create the database file.
26
+ db = Database.create(DB_FILE, DB_USER_NAME, DB_PASSWORD, 1024, 'ASCII')
27
+ else
28
+ # Create the databse object.
29
+ db = Database.new(DB_FILE)
30
+ end
31
+
32
+ # Obtain a connection to the database.
33
+ db.connect(DB_USER_NAME, DB_PASSWORD) do |cxn|
34
+ # Create the database table.
35
+ cxn.execute_immediate(CREATE_TABLE_SQL)
36
+
37
+ # Insert 50 rows into the database.
38
+ decimal = 1.0
39
+ cxn.start_transaction do |tx|
40
+ s = Statement.new(cxn, tx, INSERT_SQL, 3)
41
+ 1.upto(20) do |number|
42
+ s.execute_for([number, "Number is #{number}.", decimal, Time.new])
43
+ decimal = decimal + 0.24
44
+ end
45
+ s.close
46
+ end
47
+
48
+ # Select back the rows inserted and display them
49
+ rows = cxn.execute_immediate(SELECT_SQL)
50
+ rows.each do |row|
51
+ puts "-----"
52
+ puts "Test Id: #{row['TESTID']}"
53
+ puts "Test Text: '#{row['TESTTEXT']}'"
54
+ puts "Test Float: #{row['TESTFLOAT']}"
55
+ puts "Test Created: #{row['CREATED']}"
56
+ puts "-----"
57
+ end
58
+ rows.close
59
+
60
+ # Drop the table.
61
+ cxn.execute_immediate(DROP_TABLE_SQL)
62
+ end
63
+ rescue Excepton => error
64
+ puts error.message
65
+ end