Foundation Db2 and Python: Access Db2 with Module-Based API Examples Using Python 1st Edition W. David Ashley instant download
Foundation Db2 and Python: Access Db2 with Module-Based API Examples Using Python 1st Edition W. David Ashley instant download
https://ebookmeta.com/product/foundation-db2-and-python-access-
db2-with-module-based-api-examples-using-python-1st-edition-w-
david-ashley-2/
https://ebookmeta.com/product/foundation-db2-and-python-access-
db2-with-module-based-api-examples-using-python-1st-edition-w-
david-ashley-2/
https://ebookmeta.com/product/practical-explainable-ai-using-
python-artificial-intelligence-model-explanations-using-python-
based-libraries-extensions-and-frameworks-pradeepta-mishra/
https://ebookmeta.com/product/learn-opencv-with-python-by-
examples-2nd-edition-james-chen/
https://ebookmeta.com/product/the-palgrave-schopenhauer-handbook-
palgrave-handbooks-in-german-idealism-1st-edition-sandra-
shapshay/
Implantology Step by Step 1st Edition Christoph T
Sliwowski
https://ebookmeta.com/product/implantology-step-by-step-1st-
edition-christoph-t-sliwowski/
https://ebookmeta.com/product/supply-network-5-0-how-to-improve-
human-automation-in-the-supply-chain-1st-edition-bernardo-
nicoletti/
https://ebookmeta.com/product/historical-modernisms-time-history-
and-modernist-aesthetics-1st-edition-jean-michel-rabate/
https://ebookmeta.com/product/nfpa-409-standard-on-aircraft-
hangars-2022-edition-national-fire-protection-association/
https://ebookmeta.com/product/deployable-multimodal-machine-
intelligence-applications-in-biomedical-engineering-1st-edition-
hongliang-ren/
Essentials of Pharmacology for Nurses Barber
https://ebookmeta.com/product/essentials-of-pharmacology-for-
nurses-barber/
W. David Ashley
Apress Standard
The publisher, the authors and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
1. Introduction to Db2
W. David Ashley1
(1) Austin, TX, USA
Welcome to this introduction to Db2. Since you are here, you are likely
looking for a place to get started with Db2. Our hope is that this book
will be that first step you are looking for. This book is meant to be an
introduction to the Db2 environment and to the Python interface. The
first half of the book will cover Db2 at a level that should be of interest
to both administrators and programmers. It will cover many aspects of
Db2 that you will make use of in either of the two roles. The last half of
the book will concentrate on using the Python programming language
to interface to Db2. While mainly oriented to programmers,
administrators will find it useful as well for some of their everyday
tasks.
Db2 has a long history and is the first relational database
implementation. It was first proposed by Edgar Frank “Ted” Codd in a
paper titled “A Relational Model of Data for Large Shared Data Banks” in
1969 while working at the IBM’s San Jose Research Laboratory in
California. In the next four years, IBM researchers worked to create a
system based on the principles described in Codd’s paper (called
System R). During this time, it became obvious that a new language was
needed to interact with the new system. Codd wrote a new paper “A
Data Base Sublanguage Founded on Relational Calculus,” which became
the basis for the new language called DSL/Alpha. This quickly went
through some name changes but eventually ended up being called SQL,
short for Structured Query Language.
Eventually there was an effort in the 1970s to port DSL/Alpha to the
370 mainframe environment. It was renamed to Database 2 in 1982.
The next year it was made available to the public with another name
change, DB2. This was a limited release but was highly regarded by the
customers that evaluated it. The customers actually pushed IBM to
deliver DB2 to a wider set of customers. IBM was somewhat reluctant
because they were trying to hold on to their IMS/DB market share. But
eventually the customers won out, and DB2 began to spread to other
platforms including OS/2, AIX/RS6000, and Windows.
Over the next two decades, the product went through a number of
name changes and several platform code bases. Recently with the
release of version 11.1, IBM rebranded the entire product line and
brought the code bases into a small number of code bases. The
following set of products are now the standard offerings:
Db2 (formerly DB2 LUW)
Db2 for z/OS (formerly DB2 for z/OS)
Db2 Hosted (formerly DB2 on Cloud)
Db2 on Cloud (formerly dashDB for Transactions)
Db2 Event Store (a new in-memory database for event-driven
transaction processing)
Db2 Warehouse on Cloud (formerly dashDB)
Db2 Warehouse (formerly dashDB Local)
IBM Integrated Analytics System (a new system platform that
combines analytic performance and functionality of the IBM
PureData System with IBM Netezza)
The code bases for today’s Db2 offerings share a common code base
that makes porting the code to another hardware/software platform a
relatively easy process. The SQL code base has been standardized so
that it is the same across all platforms, making moving to another
platform an easy task from a programming perspective.
There is also a current movement in programming applications with
embedded SQL. These types of applications are very hard to port from
one platform to another without major code modifications. Instead,
IBM is moving (where possible) to an API that can be called to process
SQL statements and make use of programming language variables for
Exploring the Variety of Random
Documents with Different Content
sprang a serious leak, and the way in which this was stopped makes
most interesting reading to all lovers of ships. Her commander at
that time, Captain Martin Pring, wrote to the Company on the 12th
of November of the year mentioned that about a fortnight before the
Royal James had reached Swally—the port of Surat—“we had a great
leak broke upon us in the James, which in four hours increased six
foot water in hold, and after we had freed it and made the pumps
suck, it would rise thirteen inches in half-an-hour. It was a great
blessing of God that it fell out in such weather, by which means we
had the help of all the fleet, otherwise all our company had been
tired in a very short time. The 9th, we made many trials with a
bonnet stitched with oakum under the bulge of the ship, but it did
no good. The 11th, we basted our spritsail with oakum and let it
down before the stem of the ship and so brought it aft by degrees:
in which action it pleased God so to direct us that we brought the
sail right under the place where the oakum was presently sucked
into the leak: which stopped it in such sort that the ship made less
water the day following than she had done any day before from the
time of our departure out of England.”
The device here employed was well known to the old-fashioned
sailor, and designated “fothering.” Briefly the idea was as follows. In
order to stop the leak a sail was fastened at the four corners and
then let down under the ship’s bottom, a quantity of chopped rope-
yarns, oakum, cotton, wool—anything in the least serviceable for the
job—being also put in. If you were lucky you would find that after
the first few attempts the leak would have sucked up some of the
oakum or whatever was put into the sail, and so the water would
not pour in as badly. This device certainly saved Captain Cook during
one of his voyages after his ship had struck a rock and the sea
poured in so quickly that the pumps were unable to cope with it. In
the description given above by Captain Pring you will notice that he
used his spritsail for this purpose. This was a quadrilateral sail set at
the end of the bowsprit, but was abolished from East Indiamen and
other ships in the early part of the nineteenth century. At first, you
will observe, the bonnet—doubtless the bonnet of the mainsail—the
use of which we described on an earlier page, was tried and lowered
under the “bulge” (or, as we now say, the “bilge”) of the ship.
“Stitched with oakum” means that the little tufts of oakum were
lightly stitched to the canvas just to keep them in position until the
suction of the leak drew them up the hole away from the canvas.
When he says he “basted” the spritsail with oakum he means again
that the latter was sewn with light stitches. This spritsail was
lowered down at the bows till it got below the ship’s forefoot and
then brought gradually aft till the position of the leak was reached,
and then the oakum was sucked up with the happy result noted.
This all reads much simpler than it was in actuality: and you can
imagine that it was no easy matter getting this sail into its exact
position while the ship was plunging and rolling in a seaway.
Eventually the Royal James got over the bar at Swally, and a
consultation was then held aboard her by Captain Pring and a
number of other captains as to what had now best be done. One
opinion was to careen her so as to get at the leak and caulk it.
Another opinion was to “bring her aground for the speedy stopping
of her dangerous leak.” But these captains had before their minds
the recollection that the Trade’s Increase had been lost whilst being
careened, and another ship named the Hector likewise: so they
unanimously agreed that the best thing would be to put the Royal
James ashore, first taking out of her the merchandise. They were
more than a little nervous as to how this big ship would take the
ground, so “for a trial” they brought ashore the Francis, an
interloping vessel which they had captured. When it was seen that
the Francis seemed to take the ground all right and that she lay
there three tides without apparent injury “and never complained in
any part,” they put the Royal James ashore also. Unluckily this was
not with the same amount of success, “for she strained very much
about the midship and made her bends to droop: which caused us to
haul her off again so soon that we had not time to find the leak. Yet
(God be praised) since we came afloat her bends are much righted
and she hath remained very tight: God grant she may so long
continue.”
When Sir Thomas Roe went out from England in the year 1615 to
Surat as English Ambassador to the Great Mogul, he was
accompanied by Edward Terry, his chaplain. The latter has left
behind an account of his voyage to India, and though we cannot do
much more than call attention thereto, we may in passing note that
this setting forth shows how much valuable time was wasted in
those days waiting for a fair wind. For these seventeenth-century
ships had neither the fine lines nor the superiority of rig which was
afterwards to make the East Indiamen famous throughout the world.
The Company’s seventeenth-century ships were clumsy as to their
proportions, they were built according to rule-of-thumb, the stern
was unnecessarily high, the bows unnecessarily low. Triangular
headsails had not yet been adopted, except by comparatively small
fore-and-aft-rigged craft, such as yachts and coasters. The mizen
was still of the lateen shape, but all the other sails were
quadrilateral, even to the spritsail, which was suspended at the
outer end of the bowsprit and below that spar. Above the latter on a
small mast was hoisted another small squaresail, and then at the
after end of the bowsprit (which was very long and practically a
mast) came the foremast, stepped as far forward as it could go.
With this unhandy rig, the bluff-bowed hulls with their clumsy
design and heavy tophamper could make little or no progress in a
head wind. They were all right for running before the wind, or with
the wind on the quarter: but not only could they not point close to
the wind, but even when they tried they made a terrible lot of
leeway. It was therefore hopeless to try and beat down the English
Channel. Most seamen are aware that the prevailing winds over the
British Isles are from the south-west, but that often between about
February and the end of June, more especially in the earlier part of
the year, one can expect north-east or easterly spells. The old East
Indiamen therefore availed themselves of this. For a fair wind down
Channel was a thing much to be desired, and a long time would be
spent in waiting for it. As these awkward ships had to work their
tides down the River Thames, then drop anchor for a tide, and take
the next ebb down, their progress till they got round the North
Foreland was anything but fast.
Of all this Edward Terry’s account gives ample illustration. He was
a cleric and no seaman, but he had the sense of observation and
recorded what he observed. It was on the 3rd of February 1615 that
the squadron, including the flagship Charles—a “New-built goodly
ship of a thousand Tuns (in which I sayled) ... fell down from
Graves-send into Tilbury Hope.” Here they remained until 8th
February, when they weighed anchor, and not till 12th February had
they weathered the North Foreland and brought up in the Downs,
where they remained for weeks waiting till a fair wind should oblige
them. On the 9th of March the longed-for north-easter came, when
they immediately got under way and two days later passed the
meridian of the Lizard during the night. With the wind in such a
quarter these Indiamen would bowl along just as fast as their ill-
designed hulls could be forced through the water, making a lot of
fuss and beating the waves instead of cutting through them as in the
case of the last of the East Indiamen which ever sailed.
By the 19th of May they had passed the Tropic of Capricorn and
Terry marvelled at the sight of whales, which were “of an exceeding
greatnesse” and “appear like unto great Rocks.” Sharks were seen,
and even in those days the inherent delight of the seaman for
capturing and killing his deadly enemy was very much in existence.
As these cruel fish swam about the Charles the sailors would cast
overboard “an iron hook ... fastened to a roap strong like it, bayted
with a piece of beefe of five pounds weight.”
THE “SERINGAPATAM,” EAST INDIAMAN, 1,000 TONS.
Larger image
The East India Company’s progress was anything but a straight, easy
path. We must never forget that if it made big profits—and when
examined these figures, taken on an average, are not so colossal as
they seem at first sight—the risks and responsibilities were very far
from insignificant. Quite apart from the difficulties out in India, and
the absence of the invention of telegraphy thus making it difficult to
keep a complete control over the factors and trade; quite apart, too,
from the pressure which was harassing the Company from all sides—
public opinion which grudged this monopoly: shipowners who
wanted to raise the cost of hire: and Parliament which kept
controlling the Company by legislation—there were two other
sources of worry which existed.
The first of these was the continued insults by the press-gangs,
and the consequent inconvenience to the East India Company and
the great danger to their ships and cargoes. The second worry was
the ever-present possibility during the long-drawn-out wars of losing
also ships and goods by attack from the enemy’s men-of-war. In
both respects the position was not easy of solution. On the one
hand, it was obvious that the Company’s trade was likely to be
crippled; but, on the other, the Government must come first in both
matters. The navy was in dire need of men. All that it had were not
enough. Men who had been convicted and sentenced for smuggling
—some of the finest sailors in the country—were shipped on board
to fight for the land that gave them birth. All sorts of rough
characters were rounded up ashore and sent afloat by the press-
gangs, but even then the warships needed more.
Now the crews of these eighteenth-century East Indiamen were
such skilled seamen, so hardened to the work of a full-rigged ship,
so accustomed to fighting pirates, privateers and even the enemy’s
men-of-war, that it was no wonder the Admiralty in their dilemma
overstepped the bounds and shipped them whenever they could be
got. A favourite custom was to lie in wait for the homeward-bound
East Indiamen, and when these fine ships had dropped anchor off
Portsmouth, in the Downs, or even on their way up the Thames,
they would be boarded and relieved of some of their crew: to such
an extent, sometimes, that the ship could not be properly worked. I
have carefully examined a large number of original manuscripts
which passed between the Admiralty and the East India Company of
the eighteenth century, and there runs through the period a
continuous vein of complaint from the latter to the former, but there
was very little remedy and the Company had to put up with the
nuisance.
On the 21st of December 1710, for instance, the Company’s
secretary, Thomas Woolley, sends a letter from the directors
complaining to the Admiralty of the press-gang actually invading
East India House, Leadenhall Street, one day during the same
month, “on a pretence of searching for seamen.” As a matter of fact
the press-gang had come to carry off the most capable of the
Company’s crews, who happened to be present at that time. Very
strongly the Company wrote complaints to the Admiralty that the
press-gangs would board the East Indiamen lying off Spithead
(bound for London) and take out all the able-bodied seamen they
could lay their hands on. These men had to go whether they liked it
or not, and the Company’s officers were indignant but powerless.
But it added injury to insult that the press-gangs replaced the picked
men taken out by “such as have been either unskilful in their duty or
careless and refractory in the performance of it,” as one of the
letters remarks. The Company therefore begged that no man might
be taken out until the East Indiamen should arrive at their moorings,
or at least till they came into the London river: for, they pointed out,
the ships had very valuable cargoes on board, and this seizing of
men exposed them to very great danger, it being often impossible to
replace the men taken out.
THE PRESS GANG AT WORK.
These convoys took the East Indiamen sometimes even from the
Thames down Channel as far as Spithead. Sometimes they picked
the latter up only at the Downs, escorting them for several hundred
miles away from the English coast out into the Atlantic. These
merchantmen were similarly met at St Helena and escorted home,
the men-of-war being victualled for a period of two months. Even if
an East Indiaman were able to arrive singly and run into the
Hamoaze (Plymouth Sound) on her way home, having successfully
eluded hostile ships roving off the mouth of the English Channel, it
was deemed advisable for her to wait at Plymouth until she could be
escorted by the next man-of-war bound eastward to the Thames.
There were plenty of French privateersmen lurking about the
Channel, and, at any rate about the year 1716, there were also
Swedish privateers on the prowl in the same sea ready to fall upon
any East Indiaman going in or out of the Downs.
One notorious Swede of this occupation was La Providence, of 26
guns. She was commanded by Captain North Cross. The latter was
an Englishman who had been tried and sentenced to death for some
crime, but he had succeeded in making his escape from Newgate,
and had fled the country. He had crossed the North Sea and had
obtained from Sweden letters of marque to rove about as a
privateer. His crew were a rough crowd of desperate fellows of many
nations, and this ship was very fond of lying in Calais roads ready to
get under way and slip across the English Channel so soon as an
outward-bound East Indiaman was known to be in the Downs. Now,
in the month of November 1717, the skipper of La Providence was
lying in his usual roadstead, and tidings came to him concerning one
of the Company’s ships then in the Downs.
The privateer was kept fully informed by means of those fine
seamen, but doubtful characters, who lived at Deal. They were some
of the toughest and most determined men, who stopped at nothing.
For generations the men of Deal had been the most notorious
smugglers of the south-east corner of England: and that was saying
a great deal. They were a brave, fearless class of men, but brutal of
nature and always ready to get to windward of the law, if ever a
chance presented itself. They handled their open luggers with a
wonderful dexterity, for which their successors are even yet famous.
But they were lawless to their finger-tips. So on the present occasion
when the East Indiaman was in the Downs, one of these Deal men
sailed his little craft across the strong tides of Dover Straits and
brought the information to the privateer. The messenger asserted
that the East Indiaman had nearly £60,000 on board in cash, so
Cross got under way, averring that he would get this amount or
“Loose his Life in the Attempt.” Whether he succeeded in his attempt
I regret I am unable to say. As far as was practicable these East
Indiamen were wont, in those strenuous times, to wait for a convoy,
but there were times when they could not afford to wait till one of
his Majesty’s ships was at liberty. On those occasions the ships
would wait till they numbered a small squadron, and then voyaging
together would resolve to run all risks. There is on record the case of
a French squadron consisting of a “64” and two frigates arriving off
the island of St Helena, where the East Indiamen were wont to call.
The Frenchmen had come here in order to fall upon the homeward-
bound fleet who would soon be seen. But the longboatB of one of
these merchantmen was fitted out, and under the command of a
midshipman succeeded in getting to windward of the Frenchmen
unperceived and was able to give the approaching English ships
warning of the danger that awaited them. Six of the Company’s fleet
fell in with the enemy and kept up a running fight for several days,
until they anchored in All Saints’ Bay. Here the French blockaded
them, but it was to no purpose, for these merchantmen succeeded
in escaping and reaching England in safety.
The Royal Navy assisted the Company’s ships in quite another
manner as well. Often enough after enduring heavy weather in the
Bay of Biscay or English Channel these East Indiamen would put into
Plymouth and obtain permission from the Admiralty to obtain from
the latter’s stores a new bowsprit, a new mast, or other spar, the
Company of course paying for the expense. The royal dockyard also
on the Medway was similarly found of great service, as, for instance,
early in the eighteenth century, when the Company’s ship Hannover
had the misfortune to run on to a sandbank whilst going down the
Thames to the Downs. The ship thus suffered damage and was not
in a fit condition to proceed to the East. Permission was asked and
obtained for her to be taken into Sheerness, where the naval
authorities could admit her into dry dock, warehouse her cargo,
supply materials and repair the injuries that had been made.
So also on another occasion, in September 1720, the East
Indiaman Goodfellow was lying at Gravesend outward bound. It was
discovered at the last moment that unfortunately all the beer on
board was spoilt, and since there was no time “to detain her till
more can be brew’d,” the Company’s directors had to request the
Admiralty victualling office to furnish the ship with 12 tons of beer at
the Company’s expense. But the naval officials were not always so
obliging as this. Towards the end of the year 1721 the East Indiaman
Cæsar, outward bound for Mocha, had the misfortune to damage by
friction one of her cablesC owing to the latter getting foul of the
wreck of the Carlisle. Those were the days when cables were still
made of hemp, and were always liable, except when special steps
were taken, to injury when rubbing along foul ground. As she lay in
the Downs, the Cæsar’s master, Captain Mabbott, asked the naval
storekeeper at Deal if he would spare him a new cable in case
another storm should spring up. Mabbott was by no means pleased
when the storekeeper replied very properly that inasmuch as he had
received no orders to oblige merchant ships in that manner, he was
not able to comply with the request. However matters were
eventually set right by the Company obtaining the Admiralty’s
permission.
A voyage in an East Indiaman of those days was often full of
adventure. After proceeding from the Downs the ship cleared the
western mouth of the English Channel and then steered “W and to
WSW.” It took three months to reach the Cape of Good Hope, and
even then it was not too far south to fall in with French men-of-war.
After calling at Spithead outward bound they were wont to sail
through the Needles passage. The seamen were probably better
situated in these East Indiamen than in any other merchant ship, but
they were not allowed a soft time. They were kept at it with setting
and stowing of canvas, spreading stuns’ls in fair weather or taking in
upper canvas in heavy gales. There were plenty of guns on board to
be served, so drill formed no small part of their duties. A seaman
went on board with his sea-chest and his bedding, and in those
rough, hard-swearing days, long before ever the sailor had his trade
union, he was treated with no light hand. There is an instance of the
way slackness was wont to be punished on board the East Indiaman
Greenwich. This particular occurrence belongs to the year 1719 and
happened when the watch had been called. As some of the men did
not turn out as smartly as they ought, the boatswain took out his
knife and cut down their hammocks, to their great discomfort and
indignation. So infuriated in fact were the crew that they declined to
go on the next voyage until the boatswain had been discharged.
Some idea of the kind of vessels which the Company were hiring
for their service about the year 1730 may be gathered from the
following list, which has been taken direct from the original official
documents:—
Name of Ship Commander Tons Men Guns
Devonshire Lawrence Prince 470 94 30
Prince Augustus Francis Gostlin 495 99 36
Lyell Charles Small 470 94 30
Princess of Wales Thomas Gilbert 460 92 30
Middlesex John Pelly 430 86 30
Mary Thomas Holden 490 98 34
Derby William Fitzhugh 480 96 32
London Robert Bootle 490 98 34
Dawsonne Francis Steward 480 96 32
Craggs Caleb Grantham 380 76 26
Bridgwater Edward Williamson 400 80 28
Prince William William Beresford 480 96 30
Lethieullier John Shepheard 470 94 30
Hartford Francis Nelly 460 92 30
Macclesfield Robert Hudson 450 90 30
Cæsar William Mabbott 440 88 30
Harrison Samuel Martin 460 92 30
Walpole Charles Boddam 495 99 32
Frances John Lawson 420 84 30
Duke of Cumberland Benjamin Braund 480 96 30
George George Pitt 480 96 30
Aislabie William Birch 400 80 26
Stretham George Westcott 470 94 30
Ockham William Jobson 480 96 30
It will be noticed that not one of these is really a big ship and that
while the average is somewhere between 400 and 500 tons, yet not
one exceeds 495 tons. The directors settled the size of ship required
and the owners saw that it was supplied. The size of the crews will
be seen to be very large, but this is explained not only because