28075
28075
28075
com
https://textbookfull.com/product/java-ee-web-application-
primer-building-bullhorn-a-messaging-app-with-jsp-servlets-
javascript-bootstrap-and-oracle-1st-edition-dave-wolf/
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-loucas/
textboxfull.com
https://textbookfull.com/product/murach-s-java-servlets-and-jsp-3rd-
edition-murach-training-reference-joel-murach-michael-urban/
textboxfull.com
https://textbookfull.com/product/java-ee-6-with-
glassfish-3-application-server-1st-edition-heffelfinger-david/
textboxfull.com
The Definitive Guide to JSF in Java EE 8: Building Web
Applications with JavaServer Faces Bauke Scholtz
https://textbookfull.com/product/the-definitive-guide-to-jsf-in-java-
ee-8-building-web-applications-with-javaserver-faces-bauke-scholtz/
textboxfull.com
https://textbookfull.com/product/building-web-and-mobile-arcgis-
server-applications-with-javascript-lewin/
textboxfull.com
https://textbookfull.com/product/beginning-ejb-in-java-ee-8-building-
applications-with-enterprise-javabeans-jonathan-wetherbee/
textboxfull.com
https://textbookfull.com/product/responsive-web-design-by-example-
embrace-responsive-design-with-html5-css3-javascript-jquery-and-
bootstrap-4-hussain/
textboxfull.com
https://textbookfull.com/product/beginning-jsp-jsf-and-tomcat-java-
web-development-expert-s-voice-in-java-2-new-edition-zambon-giulio/
textboxfull.com
Java EE Web
Application
Primer
Building Bullhorn: A Messaging
App with JSP, Servlets, JavaScript,
Bootstrap and Oracle
—
Dave Wolf
A.J. Henley
Java EE Web
Application Primer
Building Bullhorn: A Messaging
App with JSP, Servlets,
JavaScript, Bootstrap and
Oracle
Dave Wolf
A.J. Henley
Java EE Web Application Primer: Building Bullhorn: A Messaging App
with JSP, Servlets, JavaScript, Bootstrap and Oracle
v
Table of Contents
vi
Table of Contents
vii
Table of Contents
Index�������������������������������������������������������������������������������������������������141
viii
About the Authors
Dave Wolf is a certified Project Management
Professional (PMP) with over 20 years of
experience as a software developer, analyst,
and trainer. His latest projects include
collaboratively developing training materials
and programming bootcamps for Java and
Python.
ix
About the Technical Reviewer
Manuel Jordan Elera is an autodidactic
developer and researcher who enjoys learning
new technologies for his own experiments and
for creating new integrations.
Manuel won the 2010 Springy Award—
Community Champion and Spring Champion
2013. In his little free time, he reads the Bible
and composes music on his guitar. Manuel
is known online as dr_pompeii. He has
tech reviewed numerous books for Apress,
including Pro Spring Messaging (2017), Pro Spring, 4th Edition (2014),
Practical Spring LDAP (2013), Pro JPA 2, Second Edition (2013), and
Pro Spring Security (2013).
Read his 13 detailed tutorials about many Spring technologies or
contact him through his blog at http://www.manueljordanelera.
blogspot.com. You can also follow him on his Twitter account,
@dr_pompeii.
xi
Introduction
Are you a Java developer wondering how to create an Enterprise
application? Do you find the different components overwhelming or
confusing, not knowing how they go together? We’re here to help. What if
you could just get an example application working and use that knowledge
to continue your Java journey?
This book and the accompanying code will show you one way to
create a website. It’s not the only way. It may not be the best way for
every application. But it’s a way that will introduce you to the different
components of Java Enterprise application development. And it’s a good
way to get started.
In Java EE Web Application Primer, you’ll learn the basics of Java EE
application development. You’ll see how the parts connect. You will have
the Java code for a complete, working application.
The Software
Our students take our courses to learn how to program for large
companies. We have found these are the skills most requested by the
companies hiring our students. We choose to use Java 8, Oracle 12c, and
Eclipse for developing the application. Similarly, we choose to use JPA
(Java Persistence API) instead of Hibernate. We choose JSTL (Java Standard
Tag Library) over other available options. Again, these technologies teach
core skills without hiding all the implementation details from the student.
Our application is designed to teach. We provide the complete source code.
xiii
Introduction
You will learn much simply by reviewing and modifying the source code.
This book answers the questions you may have after working with the
source code, and the source code helps explain how the concepts in this
book have been implemented.
xiv
Introduction
If you’re ready to get started and develop your first Java Enterprise web
application, we thank you for choosing our book to begin your journey.
Know that you will face challenges and frustrations. You aren’t alone. We
have found that as our students worked through those, they learned more
about software development than we could ever teach in a book. You’re in
the right place. Wait no longer. It’s time to move on to Chapter 1!
xv
CHAPTER 1
Getting Started
VirtualBox allows you to create virtual computers within your physical
computer, enabling you to run multiple computers on one system. Setting
up VirtualBox requires very few steps. Once installed, you can then import
an existing virtual computer and begin work using that system.
Click and run the file to install VirtualBox just like with any other
software you’ve ever downloaded. If you are using Windows, double-click
the setup file and follow the prompts to install. If you are using a Mac, open
the DMG file that you downloaded and drag the VirtualBox file to your
Applications folder. During the installation, keep all of the options set to
their default.
Start the VirtualBox program. VirtualBox allows you to manage
your various virtual machines and easily create new ones. You can run
VirtualBox directly from the installation program, or you can start it from
the desktop icon.
Once you have the Oracle virtual machine file ready, select File ➤
Import Appliance in the menu bar. Click the Open Appliance button to
select the Oracle virtual machine file. Navigate to the file with the .ova
file extension. Selecting this file will open a dialog box in VirtualBox that
displays the settings. You can select the Import button from here. The next
window will show you the configuration of the current virtual appliance.
Once you click on Import, VirtualBox will copy the disk images and
create a virtual machine with the settings described in the dialog. You will
see the Oracle virtual machine in the VirtualBox Manager’s list of virtual
machines. The VirtualBox Manager is the first screen that opens when you
open VirtualBox. Select your machine, click Start, and give it time to load,
then you can work with that machine as if it were a separate computer.
2
Chapter 1 Getting Started
Note If you’re not using the Oracle virtual machine, you can
complete everything in this book using Windows.
You can download and install Oracle database version 12c for
Windows at http://www.oracle.com/technetwork/database/
enterprise-edition/downloads/database12c-win64-
download-2297732.html.
You will also need to install SQL Developer, which you can find at
http://www.oracle.com/technetwork/developer-tools/
sql-developer/downloads/index.html.
Finally, you will need to install Eclipse Oxygen from http://www.
eclipse.org/downloads.
3
CHAPTER 2
What Is a Database?
A database is a place to permanently store data for retrieval in a safe,
efficient way. A database allows us to create data and save it permanently.
It allows us to retrieve previously created data, update existing data, or
delete existing data.
A transaction groups SQL statements so that they are all applied to
the database. If one statement fails for some reason, all the statements
are undone from the database. Transactions ensure data integrity.
Transactions distinguish a database management system such as Oracle
from a file system.
The properties of a database transaction that ensure data validity are
atomicity, consistency, isolation, and durability.
The database stores data in sets, which are most commonly viewed as
tables. One row of a database table represents a record containing related
attributes, called fields. Fields are represented by the columns in a table.
Referential Integrity
Your database management system (DBMS) supports referential integrity.
The goal of referential integrity is to avoid having “orphaned” data.
Orphaned data can happen when you are deleting or updating the data
in your tables; for example, if you have a post in your database that does
not have a matching user. This shouldn’t happen and is often the result
of importing poorly formatted data or inadvertently deleting a user. A
database management system such as Oracle can enforce referential
integrity to prevent this by denying changes that will result in orphaned
data.
Null Values
Sometimes there is no value in a column of a row. In this case, the column
stores a NULL value. You can think of this as a flag to indicate the absence
of data. NULL is different from the numeric value zero or a string with a
length of zero characters. It is neither. It is nothing, because no value has
been stored in the column for this record. NULL, it turns out, is very useful.
You can search for a field in records that contain NULL and know that they
are the ones with no value in the field.
6
Chapter 2 What Is a Database?
Joining Tables
Relationships are a means to join data to different tables. This helps you
avoid redundancy in the tables. You can divide your data into different
tables—entering it only once—and then reference it from other tables by
establishing relationships.
7
Chapter 2 What Is a Database?
Normalization
In a normalized data structure, each table contains information about a
single entity and each piece of information is stored in exactly one place.
Normalization is the process of efficiently organizing data in a
database. This is done by organizing the columns (fields or attributes) and
tables of a relational database to minimize data redundancy.
The goals of the normalization process are to eliminate redundant data
and ensure data dependencies make sense.
8
Chapter 2 What Is a Database?
9
Chapter 2 What Is a Database?
10
CHAPTER 3
Installing and
Running Eclipse
Your virtual machine contains all the software you need to create
Bullhorn—the Oracle Database 12c, SQL Developer, and Java 1.8—but it
doesn’t contain the Eclipse IDE. You will need to download and install that
yourself. Fortunately, the installation process is very easy.
To install Eclipse on the virtual machine, you will need to open Firefox and
download the Eclipse archive. Then, you will need to extract the files from the
archive. Next, you will need to run the setup program that is included in the
archive files. Finally, open Eclipse.
1. From the virtual machine, open the Firefox web browser. You
can get to Firefox by clicking on the Applications menu and
selecting the icon for Firefox Web Browser.
5. Select the option to open with the Archive Manager when this
window is displayed. The Archive Manager is the program that
will extract your files.
11. Accept the default workspace. This is where your project files
will be kept.
12
Chapter 3 Installing and Running Eclipse
3. Notice that the port numbers are shown in the table on the
right. Click to edit; for example:
4. Once you change the port number for HTTP from 8080 to 9000,
you should press Ctrl + S to save the change and restart the
server.
Your application should now run without conflict. If you do get a conflict, then
you’ve chosen another used port. Repeat the process with a different port
number. It’s best to select a port within the range of 1025 to 65535. You can
research “Well-known port numbers” to find many articles explaining the
reasoning here.
13
CHAPTER 4
JPA (data
access)
Classes
Bullhorn Overview Diagram
Session - visible to all servlets and JSPs
Session times out 20 minutes after last accessed
Database
User object in session is available to all servlets and JSPs Posts Table
Users Table
Newsfeed
Login Servlet Home Servlet
Servlet
Tip To keep your HTML from getting too complicated, use CSS
(Cascading Style Sheets) and JavaScript to control the presentation of
your content and let HTML control the layout.
The Bullhorn application contains web pages for login, home, news
feed, and user profile. The user starts at the login page. Once the user
clicks the Login button, the request (data from the login form) will be sent
to the login servlet.
16
Chapter 4 Bullhorn Site Overview
The login servlet will validate the user against the database. A
valid user will be stored in the session, which is the website’s way of
remembering data between page views. Invalid users will not get past the
login page until they enter a correct username and password combination.
We will create other objects (classes) to validate data or support the
classes and pages shown in the diagram.
Figure 4-2. The login page contains text boxes for email and
password and a button to sign in to the application
17
Chapter 4 Bullhorn Site Overview
The home page will allow each user to create a new post. Each post is
limited to 141 characters, so the home page enforces this restriction (see
Figure 4-3). Once the user is logged in, all pages contain a navigation bar at
the top that allows the user to navigate to different pages, view or edit their
profile, and search for posts containing a specific word.
Figure 4-3. The home page contains a form to submit a post to the
database. The form contains a text box and buttons to either submit
the post or clear the form.
Each page contains the same navigation bar, which allows the user
to move around the application. The navigation bar contains the logo,
links for the home page and the news feed page, and a search box. It also
displays the name of the logged-in user. The user can also select from
various user options, which is implemented as a drop-down list. These
include logging out, viewing or editing profile, and submitting feedback.
See Figure 4-4.
18
Exploring the Variety of Random
Documents with Different Content
Berlepsch, after weary hours of watching—but that she can thus
control at the instant this process of adding or withholding the sperm-
cells, certainly seems not so strange as that the spermatheca, hardly
bigger than a pin-head, could supply these cells for months, yes, and
for years. Who that has seen the bot-fly dart against the horse's legs,
and as surely leave the tiny yellow egg, can doubt but that insects
possess very sensitive oviducts, and can extrude the minute eggs
just at pleasure. That a queen may force single eggs, at will, past the
mouth of the spermatheca, and at the same time add or withhold the
sperm-cells, is, I think, without question, true. What gives added
force to this view, is the fact that other bees, wasps and ants
exercise the same volition, and can have no aid from cell-pressure,
as all the eggs are laid in receptacles of the same size. But the
Baron of Berlepsch, worthy to be a friend of Dzierzon, has fully
decided the matter. He has shown that old drone cells are as small
as new worker-cells, and yet each harbors its own brood. Very small
queens, too, make no mistakes. With no drone-cells, the queen will
sometimes lay drone-eggs in worker-cells, in which drones will then
be reared. And will, if she must, though with great reluctance, lay
worker-eggs in drone-cells.
Before laying an egg, the queen takes a look into the cell,
probably to see if all is right. If the cell contains any honey, pollen, or
an egg, she usually passes it by, though when crowded, a queen will
sometimes, especially if young, insert two or three eggs in a cell, and
sometimes, in such cases, she drops them, when the bees show
their dislike of waste, and appreciation of good living, by making a
breakfast of them. If the queen finds the cell to her liking, she turns
about, inserts her abdomen, and in an instant the tiny egg is glued,
in position (Fig, 26, b) to the bottom of the cell.
The queen, when considered in relation to the other bees of the
colony, possesses a surprising longevity. It is not surprising for her to
attain the age of three years in the full possession of her powers,
while they have been known to do good work for five years. Queens,
often at the expiration of one, two, three or four years, depending on
their vigor and excellence, either cease to be fertile, or else become
impotent to lay impregnated eggs—the spermatheca having become
emptied of its sperm-cells. In such cases the workers usually
supersede the queen; that is they destroy the old queen, ere all the
worker-eggs are gone, and take of the few remaining ones to start
queen-cells, and thus rear young, fertile and vigorous queens.
It sometimes happens, though rarely, that a fine-looking queen,
with full-formed ovaries, and large spermatheca, well-filled with male
fluid, will deposit freely, but none of the eggs will hatch. Readers of
the bee-publications know that I have frequently received such for
dissection. The first I ever got was a remarkably fine-looking Italian,
received from the late Dr. Hamlin, of Tennessee. All such queens
that I have examined seem perfect, even though scrutinized with a
high-power objective. We can only say that the egg is at fault, as
frequently transpires with higher animals, even to the highest. These
females are barren; through some fault with the ovaries, the eggs
grown therein are sterile. To detect just what is the trouble with the
egg is a very difficult problem, if it is capable of solution at all. I have
tried to determine the ultimate cause, but without success.
The function of the queen is simply to lay eggs, and thus keep
the colony populous; and this she does with an energy that is fairly
startling. A good queen in her best estate will lay two or three
thousand eggs a day. I have seen a queen in my observing hive, lay
for some time at the rate of four eggs per minute, and have proved
by actual computation of brood cells, that a queen may lay over
three thousand eggs in a day. Langstroth and Berlepsch both saw
queens lay at the rate of six eggs a minute.
The latter had a queen that laid three thousand and twenty-one
eggs in 24 hours, by actual count, and in 20 days she laid fifty-seven
thousand. This queen continued prolific for five years, and must have
laid, says the Baron, at a low estimate, more than 1,300,000 eggs.
Dzierzon says queens may lay 1,000,000 eggs, and I think these
authors have not exaggerated. Yet, with even these figures as an
advertisement, the queen bee cannot boast of superlative fecundity,
as the queen white-ant—an insect closely related to the bees in
habits, though not in structure, as the white-ants are lace-wings and
belong to the sub-order Neuroptera, which includes our day-flies,
dragon-flies, etc.—is known to lay over 80,000 eggs daily. Yet this
poor helpless thing, whose abdomen is the size of a man's thumb,
and composed almost wholly of eggs, while the rest of her body is
not larger than the same in our common ants, has no other
amusement; she cannot walk; she cannot even feed herself or care
for her eggs. What wonder then that she should attempt big things in
the way of egg-laying? She has nothing else to do, or to feel proud
of.
Different queens vary as much in fecundity as do different breeds
of fowls. Some queens are so prolific that they fairly demand hives of
India rubber to accommodate them, keeping their hives gushing with
bees and profitable activity while others are so inferior, that the
colonies make a poor, sickly effort to survive at all, and usually
succumb early, before those adverse circumstances which are ever
waiting to confront all life on the globe. The activity of the queen, too,
is governed largely by the activity of the workers. The queen will
either lay sparingly, or stop altogether, in the interims of storing
honey, while, on the other hand, she is stimulated to lay to her
utmost capacity, when all is life and activity in the hive.
It would seem that the queen either reasons from conditions, is
taught by instinct, or else that without her volition the general activity
of the worker-bees stimulates the ovaries, how, we know not, to grow
more eggs. We know that such a stimulus is born of desire, in case
of the high-holder, already referred to. That the queen may have
control of the activity of her ovaries, either directly or indirectly,
through reflex nervous action induced by the general excitement of
the bees, which always follows active storing, is not only possible,
but quite likely.
The old poetical notion that the queen is the revered and admired
sovereign of the colony, whose pathway is ever lined by obsequious
courtiers, whose person is ever the recipient of loving caresses, and
whose will is law in this bee-hive kingdom, controlling all the
activities inside the hive, and leading the colony whithersoever they
may go, is unquestionably mere fiction. In the hive, as in the world,
individuals are valued for what they are worth. The queen, as the
most important individual, is regarded with solicitude, and her
removal or loss noted with consternation, as the welfare of the
colony is threatened; yet, let the queen become useless, and she is
despatched with the same absence of emotion that characterizes the
destruction of the drones when they have become supernumeraries.
It is very doubtful if emotion or sentimentality are ever moving forces
among the lower animals. There are probably certain natural
principles that govern in the economy of the hive, and aught that
conspires against, or tends to intercept the action of these principles,
becomes an enemy to the bees. All are interested, and doubtless
more united than is generally believed, in a desire to promote the
free action of these principles. No doubt the principle of antagonism
among the various bees has been overrated. Even, the drones,
when they are being killed off in the autumn, make a sickly show of
defense, as much as to say, the welfare of the colony demands that
such worthless vagrants should be exterminated; "so mote it be;" go
ahead. The statement, too, that there is often serious antagonism
between the queen and workers, as to the destruction or
preservation of inchoate queens, yet in the cell, is a matter which
may well be investigated. It is most probable that what tends most
for the prosperity of the colony is well understood by all, and without
doubt there is harmonious action among all the denizens of the hive,
to foster that which will advance the general welfare, or to make war
on whatever may tend to interfere with it. If the course of any of the
bees seems wavering and inconsistent, we may rest assured that
circumstances have changed, and that could we perceive the
bearing of all the surrounding conditions, all would appear consistent
and harmonious.
Fig. 17.
THE DRONES.
These are the male bees, and are generally found in the hive
only from May to November: though they may remain all winter, and
are not infrequently absent during the summer. Their presence or
absence depends on the present and prospective condition of the
colony. If they are needed, or likely to be needed, then they are
present. There are in nature several hundred in each colony. The
number may and should be greatly reduced by the apiarist. These
(Fig, 17) are shorter than the queen, being less than three-fourths of
an inch in length, are more robust and bulky than either the queen or
workers, and are easily recognized when flying by their loud, startling
hum. As in other societies, the least useful make the most noise.
This loud hum is caused by the less rapid vibration of their large,
heavy wings. Their flight is more heavy and lumbering than that of
the workers. Their ligula, labial palpi, and maxillæ—like the same in
the queen bee—are short, while their jaws (Fig, 21, a) possess the
rudimentary tooth, and are much the same in form as those of the
queen, but are heavier, though not so strong as those of the workers.
Their eyes (Fig, 4) are very prominent, meet above, and thus the
simple eyes are thrown forward. Their posterior legs are convex on
the outside (Fig, 18), so, like the queens, they have no pollen
baskets. The drones are without the defensive organ, having no
sting, while their special sex-organs (Fig, 10) are not unlike those of
other insects, and have already been sufficiently described.
Fig. 18.
Fig. 19.
Worker-Bee,
magnified.
The workers—as taught by Schirach, and proved by Mlle. Jurine,
of Geneva, Switzerland, who, at the request of Huber, sought for and
found, by aid of her microscope, the abortive ovaries—are
undeveloped females. Rarely, and probably very rarely, except that a
colony is long or often queenless, as is frequently true of our nuclei,
these bees are so far developed as to produce eggs, which, of
course, would always be drone eggs. Such workers—known as
fertile—were first noticed by Riem, while Huber actually saw one in
the act of egg-laying. Except in the power to produce eggs, they
seem not unlike the other workers. Huber supposed that these were
reared in cells contiguous to royal cells, and thus received royal food
by accident. The fact, as stated by Mr. Quinby, that these occur in
colonies where queen-larvæ were never reared, is fatal to the above
theory. Langstroth and Berlepsch thought that these bees, while
larvæ, were fed, though too sparingly, with the royal aliment, by bees
in need of a queen, and hence the accelerated development. Such
may be the true explanation. Yet if, as some apiarists aver, these
appear where no brood has been fed, and so must be common
workers, changed after leaving the cell, as the result of a felt need,
then we must conclude that development and growth—as with the
high-holder—spring from desire. The generative organs are very
sensitive, and exceedingly susceptible to impressions, and we may
yet have much to learn as to the delicate forces which will move
them to growth and activity. Though these fertile workers are a poor
substitute for a queen, as they are incapable of producing any but
drones, and are surely the harbingers of death and extinction to the
colony, yet they seem to satisfy the workers, for they will not brook
the presence of a queen when a fertile worker is in the hive, nor will
they suffer the existence in the hive of a queen-cell, even though
capped. They seem to be satisfied, though they have very slight
reason to be so. These fertile workers lay indifferently in large or
small cells—often place several eggs in a single cell, and show their
incapacity in various ways.
Fig. 20.
Fig. 21.
The jaws (Fig, 21, c) are very strong, without the rudimentary
tooth, while the cutting edge is semi-conical, so that when the jaws
are closed they form an imperfect cone. Thus these are well formed
to cut comb, knead wax, and perform their various functions. Their
eyes (Fig, 5) are like those of the queen, while their wings, like those
of the drones, attain the end of the body. These organs (Fig, 3), as in
all insects with rapid flight, are slim and strong, and, by their more or
less rapid vibrations, give the variety of tone which characterizes
their hum. Thus we have the rapid movements and high pitch of
anger, and the slow motion and mellow note of content and joy.
Fig. 22.
Fig. 23.
Fig. 24.
The egg hatches in three days. The larva (Fig, 26, d, e, f, g),
incorrectly called grub, maggot—and even caterpillar, by Hunter—is
white, footless, and lies coiled up in the cell till near maturity. It is fed
a whitish fluid, though this seems to be given grudgingly, as it never
seems to have more than it wishes to eat, so it is fed quite frequently
by the mature workers. It would seem that the workers fear an
excessive development, which, as we have seen, is most
mischievous and ruinous, and work to prevent the same, by a mean
and meager diet. The food is composed of pollen and honey.
Certainly of pollen, for, as I have repeatedly proved, without pollen,
no brood will be reared. Probably some honey is incorporated, as
sugar is an essential in the nutrition of all animals, and we could
hardly account for the excessive amount of honey consumed, while
breeding, by the extra amount consumed by the bees, consequent
upon the added exercise required in caring for the brood. M. Quinby,
Doolittle, and others, say water is also an element of this food. But
bees often breed very rapidly when they do not leave the hive at all,
and so water, other than that contained in the honey, etc., cannot be
added. This makes it a question if water is ever added. The time
when bees seem to need water, and so repair to the rill and the
pond, is during the heat of summer, when they are most busy. May
this not be quaffed to slake their own thirst?
In six days the cell is capped over by the worker-bees. This cap
is composed of pollen and wax, so it is darker, more porous, and
more easily broken than the caps of the honey-cells; it is also more
convex (Fig, 26, k). The larva, now full grown, having lapped up all
the food placed before it, surrounds itself with a silken cocoon, so
excessively thin that it requires a great number to appreciably reduce
the size of the cells. These always remain in the cell, after the bees,
escape, and give to old comb its dark color and great strength. Yet
they are so thin, that cells used even for a dozen years, seem to
serve as well for brood as when first used. In three days the insect
assumes the pupa state (Fig, 26, h). In all insects the spinning of the
cocoon seems an exhaustive process, for so far as I have observed,
and that is quite at length, this act is succeeded by a variable period
of repose. The pupa is also called a nymph. By cutting open cells it
is easy to determine just the date of forming the cocoon, and of
changing to the pupa state. The pupa looks like the mature bee with
all its appendages bound close about it, though the color is still
whitish:
In twenty-one days the bee emerges from the cell. The old writers
were quite mistaken in thinking that the advent of these was an
occasion of joy and excitement among the bees. All apiarists have
noticed how utterly unmoved the bees are, as they push over and
crowd by these new-comers in the most heedless and discourteous
manner imaginable. Wildman tells of seeing the workers gathering
pollen and honey the same day that they came forth from the cells.
This idea is quickly disproved if we Italianize black-bees. We know
that for some days these young bees do not leave the hive at all,
except in case of swarming, when bees even too young to fly will
essay to go with the crowd. These young bees, like the young
drones and queens, are much lighter for the first few days.
The worker-bees never attain a great age. Those reared in
autumn may live for eight or nine months, and if in queenless stocks,
where little labor is performed, even longer; while those reared in
spring will wear out in three, and when most busy, will often die in
from thirty to forty-five days. None of these bees survive the year
through, so there is a limit to the number which may exist in a colony.
As a good queen will lay, when in her best estate, three thousand
eggs daily, and as the workers live from one to three months, it might
seem that forty thousand was too small a figure for the number of
workers. Without doubt a greater number is possible. That it is rare is
not surprising, when we remember the numerous accidents and
vicissitudes that must ever attend the individuals of these populous
communities.
The function of the worker-bees is to do all the manual labor of
the hives. They secrete the wax, which forms in small pellets (Fig,
27, a, a) under the over-lapping rings under the abdomen. I have
found these wax-scales on both old and young. According to Fritz
Müller, the admirable German observer, so long a traveler in South
America, the bees of the genus melipona secrete the wax on the
back.
The young bees build the comb, ventilate the hive, feed the larvæ
and cap the cells. The older bees—for, as readily seen in Italianizing,
the young bees do not go forth for the first one or two weeks—gather
the honey, collect the pollen, or bee-bread, as it is generally called,
bring in the propolis or bee glue, which is used to close openings,
and as a cement, supply the hive with water(?), defend the hive from
all improper intrusion, destroy drones when their day of grace is
past, kill and arrange for replacing worthless queens, destroy
inchoate queens, drones, or even workers, if circumstances demand
it, and lead forth a portion of the bees when the conditions impel
them to swarm.
When there are no young bees, the old bees will act as house-
keepers and nurses, which they otherwise refuse to do. The young
bees, on the other hand, will not go forth to glean, even though there
be no old bees to do this necessary part of bee-duties. An indirect
function of all the bees is to supply animal heat, as the very life of the
bees require that the temperature inside the hive be maintained at a
rate considerably above freezing. In the chemical processes
attendant upon nutrition, much heat is generated, which, as first
shown by Newport, may be considerably augmented at the pleasure
of the bees, by forced respiration. The bees, too, by a rapid vibration
of their wings, have the power to ventilate their hives, and thus
reduce the temperature, when the weather is hot. Thus they
moderate the heat of summer, and temper the cold of winter.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com