100% found this document useful (4 votes)
28 views54 pages

Mongodb For Java Developers Design Build And Deliver Efficient Java Applications Using The Most Advanced Nosql Database Onlineausg Francesco pdf download

The document is a promotional description of the book 'MongoDB for Java Developers' by Francesco Marchioni, which focuses on designing and building efficient Java applications using MongoDB, a leading NoSQL database. It includes an overview of the book's content, author background, and additional resources for Java developers interested in MongoDB. The document also lists related products and offers links to download various MongoDB-related ebooks.

Uploaded by

tuchenjooh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
28 views54 pages

Mongodb For Java Developers Design Build And Deliver Efficient Java Applications Using The Most Advanced Nosql Database Onlineausg Francesco pdf download

The document is a promotional description of the book 'MongoDB for Java Developers' by Francesco Marchioni, which focuses on designing and building efficient Java applications using MongoDB, a leading NoSQL database. It includes an overview of the book's content, author background, and additional resources for Java developers interested in MongoDB. The document also lists related products and offers links to download various MongoDB-related ebooks.

Uploaded by

tuchenjooh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 54

Mongodb For Java Developers Design Build And

Deliver Efficient Java Applications Using The


Most Advanced Nosql Database Onlineausg
Francesco download
https://ebookbell.com/product/mongodb-for-java-developers-design-
build-and-deliver-efficient-java-applications-using-the-most-
advanced-nosql-database-onlineausg-francesco-32704540

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Mongodb For Jobseekers Reach New Heights In Your Career With Mongodb
Justin Jenkins

https://ebookbell.com/product/mongodb-for-jobseekers-reach-new-
heights-in-your-career-with-mongodb-justin-jenkins-51679966

Pentaho Analytics For Mongodb Cookbook 1st Edition Latino Joel

https://ebookbell.com/product/pentaho-analytics-for-mongodb-
cookbook-1st-edition-latino-joel-55144806

Cosmos Db For Mongodb Developers Migrating To Azure Cosmos Db And


Using The Mongodb Api 1st Ed Manish Sharma

https://ebookbell.com/product/cosmos-db-for-mongodb-developers-
migrating-to-azure-cosmos-db-and-using-the-mongodb-api-1st-ed-manish-
sharma-55145010

Data Modeling For Mongodb Building Welldesigned And Supportable


Mongodb Databases Steve Hoberman

https://ebookbell.com/product/data-modeling-for-mongodb-building-
welldesigned-and-supportable-mongodb-databases-steve-hoberman-5048098
Pentaho Analytics For Mongodb Bo Borland

https://ebookbell.com/product/pentaho-analytics-for-mongodb-bo-
borland-5411230

50 Tips And Tricks For Mongodb Developers Get The Most Out Of Your
Database 1st Edition Kristina Chodorow

https://ebookbell.com/product/50-tips-and-tricks-for-mongodb-
developers-get-the-most-out-of-your-database-1st-edition-kristina-
chodorow-55145008

Mongodb And Python Patterns And Processes For The Popular


Documentoriented Database Ohiggins

https://ebookbell.com/product/mongodb-and-python-patterns-and-
processes-for-the-popular-documentoriented-database-ohiggins-22034546

Mongodb And Php Documentoriented Data For Web Developers Steve Francia

https://ebookbell.com/product/mongodb-and-php-documentoriented-data-
for-web-developers-steve-francia-5471214

The Definitive Guide To Mongodb The Nosql Database For Cloud And
Desktop Computing 1st Edition Eelco Plugge

https://ebookbell.com/product/the-definitive-guide-to-mongodb-the-
nosql-database-for-cloud-and-desktop-computing-1st-edition-eelco-
plugge-2246960
MongoDB for Java Developers

Design, build, and deliver efficient Java applications


using the most advanced NoSQL database

Francesco Marchioni

BIRMINGHAM - MUMBAI
MongoDB for Java Developers

Copyright © 2015 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: August 2015

Production reference: 1070815

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham B3 2PB, UK.

ISBN 978-1-78528-027-6

www.packtpub.com
Credits

Author Project Coordinator


Francesco Marchioni Shweta Birwatkar

Reviewers Proofreader
Daniel Mühlbachler Safis Editing
Weiwei Sun
Mehdi Tazi Indexer
Tejal Soni

Commissioning Editor
Veena Pagare Production Coordinator
Aparna Bhagat

Acquisition Editors
James Jones Cover Work
Aparna Bhagat
Nadeem N. Bagban

Content Development Editor


Neeshma Ramakrishnan

Technical Editor
Bharat Patil

Copy Editors
Merilyn Pereira
Laxmi Subramanian
About the Author

Francesco Marchioni is a Red Hat Certified JBoss Administrator (RHCJA)


and a Sun Certified enterprise architect working as a freelancer in Rome, Italy.
He started learning Java in 1997, and since then, he has followed the path to the
newest application program interfaces released by Sun. In 2000, he joined the
JBoss community, when the application server was running the release 2.X.

He has spent many years as a software consultant, wherein he envisioned many


successful software migrations from vendor platforms to open source products
such as JBoss AS, fulfilling the tight budget requirements of current times.

Over the past 5 years, he has been authoring technical articles for OReilly Media and
running an IT portal focused on JBoss products (http://www.mastertheboss.com).

In December 2009, he published JBoss AS 5 Development, which describes how to


create and deploy Java Enterprise applications on JBoss AS (http://www.packtpub.
com/jboss-as-5-development/book).

In December 2010, he published his second title, JBoss AS 5 Performance Tuning,


which describes how to deliver fast and efficient applications on JBoss AS
(http://www.packtpub.com/jboss-5-performance-tuning/book).

In December 2011, he published yet another title, JBoss AS 7 Configuration, Deployment,


and Administration, which covers all the aspects of the newest application server
release (http://www.packtpub.com/jboss-as-7-configuration-deployment-
administration/book).

In June 2013, he authored a new title, JBoss AS 7 Development, which focuses on


developing Java EE 6 API applications on JBoss AS 7 (https://www.packtpub.com/
application-development/jboss-7-development).
About the Reviewers

Daniel Mühlbachler got interested in computer science shortly after entering


high school, where he later developed web applications as part of a scholarship
system for outstanding pupils.

He has profound knowledge of web development (PHP, HTML, CSS/LESS, and


AngularJS), and has worked with a variety of other programming languages and
systems, such as Java/Groovy, Grails, Objective-C and Swift, Matlab, C (with Cilk),
Node.js, and Linux servers.

Furthermore, he works with some database management systems based on SQL


and also some NoSQL systems, such as MongoDB and SOLR; this is also reflected
in several projects that he is currently involved in at Catalysts GmbH.

After studying abroad as an exchange student in the United Kingdom, he completed


his bachelor's degree at the Johannes Kepler University in Linz, Austria, with a thesis
on aerosol satellite data processing for mobile visualization; this is where he also
became familiar with processing large amounts of data.

Daniel enjoys solving challenging problems and is always keen on working with new
technologies, especially related to the fields of big data, functional programming,
optimization, and NoSQL databases.

More detailed information about his experience , as well as his contact details, can be
found at www.muehlbachler.org and www.linkedin.com/in/danielmuehlbachler.
Weiwei Sun is a student of Southeast University, China, and also a student of
Monash University, Australia. He also has a double master's degree in computer
technology and information technology. He loves technology, programming, and
open source projects.

His research interests are database technology, data visualization, and application of
machine learning.

You can read more about him at http://wwsun.github.com.

Mehdi Tazi is a software engineer specializing in distributed information systems


and agile project management.

His core expertise involves managing agile scrum teams, as well as architecting
new solutions, and working with multiple technologies, such as JAVA/JEE, Spring,
MongoDB, Cassandra, HTML5, Bootstrap, and AngularJS.

He has a degree in software engineering and a master's degree in business


informatics. He also has several certifications, such as Core-Spring, MongoDB,
Cassandra, and Scrum Master Official.

You can read more about him at http://tazimehdi.com.


www.PacktPub.com

Support files, eBooks, discount offers, and more


For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.
com and as a print book customer, you are entitled to a discount on the eBook copy.
Get in touch with us at [email protected] for more details.

At www.PacktPub.com, you can also read a collection of free technical articles,


sign up for a range of free newsletters and receive exclusive discounts and offers
on Packt books and eBooks.
TM

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser

Free access for Packt account holders


If you have an account with Packt at www.PacktPub.com, you can use this to access
PacktLib today and view 9 entirely free books. Simply use your login credentials for
immediate access.
This book is dedicated to all the guys that patiently answered my questions
on MongoDB forums and to my son Alessandro that taught me
how to play 'Magic the Gathering' while waiting for replies
Table of Contents
Preface v
Chapter 1: Introduction to MongoDB 1
Getting into the NoSQL movement 1
Comparing RDBMS and NoSQL databases 4
Living without transactions 6
Managing read-write concurrency 7
MongoDB core elements 8
The heart of MongoDB – the document 9
Understanding how MongoDB stores data 10
Data types accepted in documents 11
Installing and starting MongoDB 12
Installing MongoDB on Windows 12
Installing MongoDB on Linux 13
MongoDB start up options 14
Troubleshooting MongoDB installation 15
Mongo tools 16
Introduction to the MongoDB shell 18
Inserting documents 19
Querying documents 19
Choosing the keys to return 20
Using ranges in your queries 21
Using logical operators to query data 22
Updating documents 22
Deleting data 24
Beyond basic data types 25
Arrays 25
Embedded documents 26
Some useful functions 27
Securing database access 28
Summary 30
[i]
Table of Contents

Chapter 2: Getting Started with Java Driver for MongoDB 31


Getting the Mongo JDBC driver 31
Creating your first project 32
Creating a new Java project 32
Handling authentication 35
Inserting a document 36
Creating embedded documents 38
Inserting an array of data 38
Using your own ID in documents 40
Querying data 41
Restricting the search to the first document 43
Querying the number of documents in a collection 43
Eager fetching of data using DBCursor 43
Filtering through the records 44
Updating documents 45
Deleting documents 46
Deleting a set of documents 47
Performing operations on collections 47
Listing collections 48
Dropping a collection 49
Using the MongoDB Java driver version 3 49
Running the HelloWorld class with driver v.3 50
Managing collections 51
Inserting data into the database 51
Inserting embedded documents 52
Inserting multiple documents 53
Querying documents 53
Filtering through documents 54
Updating documents 55
Deleting documents 56
Summary 56
Chapter 3: MongoDB CRUD Beyond the Basics 57
Seeing MongoDB through the Java lens 57
Extending the MongoDB core classes 58
Using the Gson API with MongoDB 62
Downloading the Gson API 62
Using Gson to map a MongoDB document 63
Inserting Java objects as a document 65
Mapping embedded documents 66
Custom field names in your Java classes 68
Mapping complex BSON types 69
Using indexes in your applications 72
Defining an index in your Java classes 75
Using compound indexes 77

[ ii ]
Table of Contents

Using text indexes in your documents 80


Coding bulk operations 83
Comparing plain inserts with BulkWriteOperations 84
Summary 85
Chapter 4: MongoDB in the Java EE 7 Enterprise Environment 87
Entering into the Java EE land 87
Getting a Java EE Container 89
Downloading WildFly 89
Starting WildFly and testing the installation 90
Designing our application 90
Designing the schema 91
Building up the Enterprise project with NetBeans 92
Configuring WildFly on NetBeans 92
Creating our project 94
Adding Java classes 99
Compiling and deploying the project 107
Compiling and deploying from the shell 107
Running the application 108
Exposing the application to external clients 109
Adding RESTful web services to our application 109
Compiling and deploying the application 112
Summary 113
Chapter 5: Managing Data Persistence with
MongoDB and JPA 115
An overview of the Java Persistence API 115
Entering Hibernate OGM 117
Building a JPA project that uses Hibernate OGM 119
Configuring the project dependencies 121
Mapping the database collections 122
Configuring persistence 125
Coding the controller and EJB classes 126
Hibernate OGM and JP-QL 128
Coding a controller bean 129
Coding the views 131
The main view 132
The newCustomer view 133
The newOrder view 134
Compiling and running the example 135
A look into MongoDB 137
Using native queries in your Hibernate OGM 138
Summary 139

[ iii ]
Table of Contents

Chapter 6: Building Applications for MongoDB with


Spring Data 141
Introducing Spring Boot 141
Getting started with Spring Boot 142
Getting started with Spring Data 143
Using the Spring repository to access MongoDB 144
Coding our Spring Boot application 145
Serving MongoDB using Spring REST 153
Using the Mongo template component to access MongoDB 157
Building up the data access layer 157
Adding the Application class 160
Creating fine grained queries using Criteria 161
Summary 163
Index 165

[ iv ]
Preface
The NoSQL movement is growing in relevance, and it is attracting more and more
developers. The MongoDB database is a well-recognized rising star in the NoSQL
world. It is a document database that allows data to persist and query data in a
nested state without any schema constraint and complex joins between documents.
Understanding when it is appropriate to use MongoDB against a relational database
and the interfaces to be used to interact with it requires some degree of experience.

This book provides all the knowledge to make MongoDB fit into your application
schema, at the best of its capabilities. It starts from a basic introduction to the driver
that can be used to perform some low level interaction with the storage. Then it
moves on to use different patterns for abstracting the persistence layer into your
applications, starting from the flexible Google JSON library, to the Hibernate OGM
framework, and finally landing on the Spring Data framework.

What this book covers


Chapter 1, Introduction to MongoDB, covers the installation steps of MongoDB and its
client tools and how to use the Mongo shell to perform basic database operations.

Chapter 2, Getting Started with Java Driver for MongoDB, introduces the Java
Driver for MongoDB using a simple Java project developed with the NetBeans
development environment.

Chapter 3, MongoDB CRUD Beyond the Basics, covers the advanced usage of the
MongoDB Java driver such as data mapping, index creation, and bulk operations.

Chapter 4, MongoDB in the Java EE 7 Enterprise Environment, demonstrates how to


create and deploy a Java Enterprise application that uses MongoDB as the storage.

[v]
Preface

Chapter 5, Managing Data Persistence with MongoDB and JPA, covers the development
of a Java Enterprise application using Hibernate Object/Grid Mapper (OGM), which
provides Java Persistence API (JPA) support for NoSQL databases.

Chapter 6, Building Applications for MongoDB with Spring Data, teaches you how
to use Spring Data and Spring Boot to leverage micro services using MongoDB
as the storage.

What you need for this book


The following software will be needed to run the examples contained in this book:

• Java Development Kit 1.7 or newer


• Mongo DB 2.6 or newer
• MongoDB JDBC Driver 2 and 3
• The NetBeans development environment (or equivalent)

All the software mentioned is freely available for downloading.

Who this book is for


This book is for Java developers and architects who want to learn how to develop
Java applications using the most popular NoSQL solution and its use cases.

Conventions
In this book, you will find a number of styles of text that distinguish between
different kinds of information. Here are some examples of these styles, and an
explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows:
"In command prompt, navigate to the bin directory present into the mongodb
installation folder and point to the folder where data is stored."

A block of code is set as follows:


MongoClient mongoClient = new MongoClient( "localhost" , 27017 );
DB db = mongoClient.getDB( "test" );
System.out.println("Successfully connected to MongoDB");

[ vi ]
Preface

When we wish to draw your attention to a particular part of a code block, the
relevant lines or items are set in bold:
MongoClient mongoClient = new MongoClient( "localhost" , 27017 );
DB db = mongoClient.getDB( "test" );
System.out.println("Successfully connected to MongoDB");

Any command-line input or output is written as follows:


> db.users.find({}).sort({"name":1})

{ "_id" : ObjectId("5506d5708d7bd8471669e674"), "name" : "francesco",


"age" : 44, "phone" : "123-456-789" }
{ "_id" : ObjectId("550ad3ef89ef057ee0671652"), "name" : "owen", "age" :
32, "phone" : "555-444-333" }

New terms and important words are shown in bold. Words that you see on the
screen, in menus or dialog boxes for example, appear in the text like this: " Now let's
add a Java class to the project. From the File menu, select Java Class under New ".

Warnings or important notes appear in a box like this.

Tips and tricks appear like this.

Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or may have disliked. Reader feedback is important for
us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to [email protected],


and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide on www.packtpub.com/authors.

[ vii ]
Preface

Customer support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.

Downloading the example code


You can download the example code files for all Packt books you have purchased
from your account at http://www.packtpub.com. If you purchased this book
elsewhere, you can visit http://www.packtpub.com/support and register to have
the files e-mailed directly to you.

Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do
happen. If you find a mistake in one of our books—maybe a mistake in the text or the
code—we would be grateful if you would report this to us. By doing so, you can save
other readers from frustration and help us improve subsequent versions of this book.
If you find any errata, please report them by visiting http://www.packtpub.com/
submit-errata, selecting your book, clicking on the errata submission form link,
and entering the details of your errata. Once your errata are verified, your submission
will be accepted and the errata will be uploaded on our website, or added to any list
of existing errata, under the Errata section of that title. Any existing errata can be
viewed by selecting your title from http://www.packtpub.com/support.

Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media.
At Packt, we take the protection of our copyright and licenses very seriously. If you
come across any illegal copies of our works, in any form, on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.

Please contact us at [email protected] with a link to the suspected


pirated material.

We appreciate your help in protecting our authors, and our ability to bring you
valuable content.

Questions
You can contact us at [email protected] if you are having a problem with
any aspect of the book, and we will do our best to address it.
[ viii ]
Chapter 1

Introduction to MongoDB
In this book, you will learn how to develop Java applications using the MongoDB
database, which is an open source document-oriented database, recognized as a
rising star in the NoSQL world. In a nutshell, MongoDB is a document database,
which allows data to persist in a nested state, and importantly, it can query that
nested data in an ad hoc fashion. It enforces no schema, so documents can optionally
contain fields or types that no other document in the collection contains.

The focus of this book is on applications development; however, we will at first


gather all the resources to connect to MongoDB and add a quick introduction to
the world of NoSQL databases. We will cover the following topics in more detail:

• A bird's eye view of the NoSQL landscape


• Installing MongoDB and client tools
• Using the MongoDB shell

Getting into the NoSQL movement


NoSQL is a generic term used to refer to any data store that does not follow the
traditional RDBMS model—specifically, the data is nonrelational and it generally
does not use SQL as a query language. Most of the databases that are categorized
as NoSQL focus on availability and scalability in spite of atomicity or consistency.

This seems quite a generic definition of NoSQL databases; however, all databases
that fall into this category have some characteristics in common such as:

• Storing data in many formats: Almost all RDBMS databases are based on
the storage or rows in tables. NoSQL databases, on the other hand, can use
different formats such as document stores, graph databases, key-value stores
and even more.

[1]
Discovering Diverse Content Through
Random Scribd Documents
and others each lay several millions of eggs. The adults rarely pay any
attention to the eggs, which are hatched directly by the heat of the sun
or by heat absorbed from the water. The length of incubation varies
much. When the young fish leaves the egg-shell it carries, in the case of
most species, a part of the yolk still hanging to its body. Its eyes are
very large, and its fins are represented by thin strips of membrane. It
usually undergoes no great changes in development from the first,
resembling the adult except in size. But some of the ocean fishes show a
metamorphosis almost as striking as that of insects or toads or frogs.
Some fishes build nests. Sticklebacks build elaborate nests in the brooks
and defend them with spirit. Sunfishes do the same, but the nests are
clumsier and not so well cared for.
The salmon is the type of fishes which run up from the sea to lay their
eggs in fresh water. The king salmon of the Columbia River, for example,
leaves the sea in the high waters of March and ascends without feeding
for over a thousand miles, depositing its spawn in some small brook in
the fall. After making this long journey to lay the eggs, the salmon
become much exhausted, battered and worn, and are often attacked by
parasitic fungi. They soon die, probably none of them ever surviving to
lay eggs a second time.
Classification.—A fish is an aquatic vertebrate, fitted to breathe the air
contained in water, and never developing fingers and toes. Accepting
this broad general definition we find at once that there are very great
differences among fishes. Some differ more from others than the
ordinary forms differ from rabbits or birds. So although we have entitled
this chapter as if all fishes belonged to the class Pisces, we cannot
arrange them satisfactorily in less than three classes.
The lancelets (Leptocardii).—The lowest class of fish-like animals is
that of the lancelets, the Leptocardii. These little creatures, translucent,
buried in the sand, of the size and form of a small toothpick, are fishes
reduced to their lowest terms. They have the form, life, and ways of a
fish, but no differentiated skull, brain, heart, or eyes. Moreover they
have no limbs, no jaws, no teeth, no scales. The few parts they do have
are arranged as in a fish, and they show something in common with the
fish embryo. Lacking a distinct head, the lancelets are put by some
zoologists in a group called the Acrania, as opposed to the Craniata,
which includes all the other vertebrates. Lancelets have been found in
the North Atlantic and Mediterranean, on the west coast of North
America, on the east coast of South America and on the coasts of Japan,
Australia, New Zealand, the East Indies and Malayan Islands. The best-
known members of the group belong to the genus Amphioxus. There are
but one to two other genera in the class.

Fig. 113.—A lamprey, Petromyzon marinus. (After Goode.)

The lampreys and hag-fishes (Cyclostomata).—The next class of


fish-like animals is that of the lampreys (fig. 113) and hag-fishes, the
Cyclostomata. The lampreys and hags are easily distinguished from the
true fishes by their sucking mouth without jaws, their single median
nostril, their eel-like shape and lack of lateral appendages or paired fins.
The hag-fishes (Myxine), which are marine, attach themselves by means
of a sucker-like mouth to living fishes (the cod particularly), gradually
scraping and eating their way into the abdominal cavity of the fish.
These hags or "borers" "approach most nearly to the condition of an
internal parasite of any vertebrate." The lampreys, or lamprey-eels as
they are often called because of their superficial resemblance to true
eels, are both marine and fresh-water in their habitat, and most of them
attach themselves to live fishes and suck their blood. They also feed on
crustacea, insects, and worms. The brook-lamprey, Lampetra wilderi, is
never parasitic. It reaches its full size in larval life and transforms simply
for spawning. The sea- and lake-lampreys ascend small fresh-water
streams when ready to lay their eggs, few living to return. Sometimes
small piles of stones are made for nests. The young undergo a
considerable metamorphosis in their development. The largest sea-
lampreys reach a length of three feet. The common brook-lampreys are
from eight to twelve inches long only.
The true fishes (Pisces).—All the other fish-like animals are grouped
in the class Pisces. They are characterized, when compared with the
lower fish-like forms just referred to, by the presence of jaws, shoulder
girdle, and pelvic girdle. The class includes both the cartilaginous and
bony fishes, and is divided into three sub-classes, namely, the
Elasmobranchii, including the sharks, rays, skates, torpedoes, etc., the
Holocephali, including the chimæras (a few strange-bodied forms), and
the Teleostomi, including all the other fishes, as the trout, catfishes,
darters, bass, herring, cod, mackerel, sturgeons, etc., etc.
The sharks, skates, etc. (Elasmobranchii).—The sharks and skates
are characterized by the possession of a skeleton composed of cartilage
and not bone, as in the bony fishes; they have no operculum; their teeth
are distinct, often large and highly specialized, and their eggs are few
and very large. There are two principal groups among Elasmobranchii,
viz., the sharks, which usually have an elongate body, and always have
the gill-openings on the sides, and the rays or skates, which have a
broad flattened body with the gill-openings always on the under side. All
the members of both groups are marine. The sharks are active, fierce,
usually large fishes, which live in the surface-waters of the ocean and
make war on other marine animals, all of the species except half a
dozen being fish-eaters. The shark's mouth is on the under side of the
usually conical head, and the animal often turns over on its back in order
to seize its prey. The largest American sharks, and the largest of all
fishes, are the great basking-sharks (Cetorhinus), which reach a length
of nearly forty feet. They get their name from their habit of gathering in
numbers and floating motionless on the surface. They feed chiefly on
fishes.
The hammer-headed sharks (Sphyrna) are odd sharks which have the
head mallet or kidney shaped, twice as wide as long, the eyes being
situated on the ends of the lateral expansions of the head. The man-
eating or great white sharks (Carcharodon) are nearly as large as the
basking-sharks, and are extremely voracious. They will follow ships for
long distances for the refuse thrown overboard. They do not hesitate to
attack man. Among the more familiar smaller sharks are the dog-fishes
and sand-sharks of our Atlantic coast.
The rays and skates are also carnivorous, but are with few exceptions
sluggish, lying at the bottom of shallow shore-waters. They feed on
crabs, molluscs, and bottom-fishes. The small common skates, "tobacco-
boxes" (Raja erinacea) (fig. 114), about twenty inches long, and the
larger "barn-door skates" (R. lævis), are numerous along the Atlantic
coast from Virginia northward. Especially interesting members of this
group, because of the peculiar character of the injuries produced by
them, are the sting-rays and torpedoes or electric-rays. The sting-rays
(Dasyatis) have spines near the base of the tail which cause very painful
wounds. The torpedoes (Narcine) have two large electrical organs, one
on each side of the body just behind the head, with which they can give
a strong electric shock. "The discharge from a large individual is
sufficient to temporarily disable a man, and were these animals at all
numerous they would prove dangerous to bathers." Very different from
the typical rays in external appearance are the saw-fishes (Pristis
pectinatis) which belong to this group. The body is elongate and shark-
like, and has a long saw-like snout. This saw, which in large individuals
may reach a length of six feet and a breadth of twelve inches, makes its
owner formidable among the small sardines and herring-like fishes on
which it feeds. The saw-fishes live in tropical rivers, descending to the
sea.
Fig. 114.—The common skate, Raja erinacea. (From Kingsley.)

The bony fishes (Teleostomi).—The bony or true fishes are


distinguished from the lampreys and sharks and rays by having in
general the skeleton bony, not cartilaginous, the skull provided with
membrane bones, and the eggs small and many. In this group are
included all the fishes of our fresh-water lakes, ponds, and streams
as well as most of the marine forms. Fish life, being spent under
water, is not familiar to most of us, and beginning students are rarely
helped enough in getting acquainted with the different kinds and the
interesting habits of fishes. But they offer a field of study which is
really of unusual interest and profit. We can refer in the following
paragraphs to but few of the numerous common and readily found
kinds, and to these but briefly.
Closely related to the sunfish, studied as example of the bony fishes,
are the various kinds of bass, as the "crappie" (Pomoxis annularis),
the calico bass (P. separoides), the rock-bass (Ambloplites rupestris)
and the large-mouthed and small-mouthed black bass (Micropterus
salmoides and M. dolomieu respectively). All the members of this
sunfish and bass family are carnivorous fishes especially
characteristic of the Mississippi valley.
Another family of many species especially common in the clear, swift,
and strong Eastern rivers is that of the darters and perches. The
darters are little slender-bodied fishes which lie motionless on the
bottom, moving like a flash when disturbed and slipping under stones
out of sight of their enemies. Some are most brilliantly colored,
surpassing in this respect all other fresh-water fishes.
Unlike the sunfishes and darters are the catfishes, composing a great
family, the Siluridæ. The catfish (Ameiurus) gets its name from the
long feelers about its mouth; from these feelers also come its other
names of horned pout, or bull-head. It has no scales, but its spines
are sharp and often barbed or jagged and capable of making a
severe wound.
Remotely allied to the catfish are the suckers, minnows, and chubs,
with smooth scales, soft fins and soft bodies and the flesh full of
small bones. These little fish are very numerous in species, some
kinds swarming in all fresh water in America, Europe, and Asia. They
usually swim in the open water, the prey of every carnivorous fish,
making up by their fecundity and their insignificance for their lack of
defensive armature. In some species the male is adorned in the
spring with bright pigment, red, black, blue, or milk-white. In some
cases, too, it has bony warts or horns on its head or body. Such
forms are known to the boys as horned dace.
Most interesting to the angler are the fishes of the salmon and trout
(fig. 115) family, because they are gamy, beautiful, excellent as food
and above all perhaps because they live in the swiftest and clearest
waters in the most charming forests. The salmon live in the ocean
most of their life, but ascend the rivers from the sea to deposit their
eggs. The king salmon (Oncorhynchus tschawytscha) of the
Columbia goes up the great river more than a thousand miles, taking
the whole summer for it, and never feeding while in fresh water.
Besides the different kinds of salmon, the black-spotted or true trout,
the charr or red-spotted trout of various species, the whitefish
(Coregonus), the grayling (Thymallus signifer) and the famous ayu of
Japan belong to this family.

Fig. 115.—The rainbow-trout, Salmo iridens. (From specimen.)

In the sea are multitudes of fish forms arranged in many families.


The myriad species of eels agree in having no ventral fins and in
having the long flexible body of the snake. Most of them live in the
sea, but the single genus (Anguilla) or true eel which ascends the
rivers is exceedingly abundant and widely distributed. Most eels are
extremely voracious, but some of them have mouths that would
barely admit a pin-head. The codfish (Gadus callarias) is a creature
of little beauty but of great usefulness, swarming in all arctic and
subarctic seas. The herring (Clupea harengus), soft and weak in
body, are more numerous in individuals than any other fishes. The
flounders (fig. 116) of many kinds lie flat on the sea-bottom. They
have the head so twisted that the two eyes occur both together on
the uppermost side. The members of the great mackerel tribe swim
in the open sea, often in great schools. Largest and swiftest of these
is the sword-fish (Xiphias gladius), in which the whole upper jaw is
grown together to form a long bony sword, a weapon of offence that
can pierce the wooden bottom of a boat.

Fig. 116.—The winter flounder, Pseudopleuronectes americanus. (After Goode.)

Many of the ocean fishes are of strange form and appearance. The
sea-horses (Hippocampus sp.) (fig. 117) are odd fishes covered with
a bony shell and with the head having the physiognomy of that of a
horse. They are little fishes rarely a foot long, and cling by their
curved tails to floating seaweed. The pipefish (Syngnathus fuscum) is
a sea-horse straightened out. The porcupine-fishes and swellfishes
(Tetraodontidæ) have the power of filling the stomach with air which
they gulp from the surface. They then escape from their pursuers by
floating as a round spiny ball on the surface. The flying-fishes
(Exocœtus) leap out of the water and sail for long distances through
the air, like grasshoppers. They cannot flap their long pectoral fins
and do not truly fly; nevertheless they move swiftly through the air
and thus escape their pursuers. In its structure a flying-fish differs
little from a pike or other ordinary fish.
For an account of the fishes of North
America see Jordan's "Manual of
Vertebrates," eighth edition, pp. 5-
173, and Jordan and Evermann's
"Fishes of North and Middle
America," where the 3,127 species
known from our continent are
described in detail with illustrative
figures.
Habits and adaptations.—The
chief part of a fish's life is devoted to
eating, and as most fishes feed on
other fishes, all are equally Fig. 117.—A sea-horse, Hippocampus
considerably occupied in providing heptagonus
Goode.)
. (After

for their own escape.


In general the provisions for seizing prey are confined to sharp teeth
and the strong muscles which propel the caudal fin. But in some
cases special contrivances appear. In one large group known
collectively as the "anglers" the first spine of the dorsal fin hangs
over the mouth. It has at its tip a fleshy appendage which serves as
a bait. Little fishes nibble at this, the mouth opens, and they are
gone. In the deep seas, many fishes are provided with
phosphorescent spots or lanterns which light up the dark waters, and
enable them to see their prey. In storms these lantern-fishes
sometimes lose their bearings and are thrown upward to the surface.
In general the more predatory in its habits any fish is the sharper its
teeth, and the broader its mouth. Among brook-fishes the pickerel
has the largest mouth and the sharpest teeth. It has been called a
"mere machine for the assimilation of other organisms." The trout
has a large mouth and sharp teeth. It is a swift, voracious, and
predatory fish, feeding even on its own kind. The sunfish is less
greedy and its mouth and teeth are smaller, though it too eats other
fish.
As means of escape, most fishes depend on their speed in swimming.
But some hide among rocks and weeds, disguising themselves by a
change in color to match their surroundings. Others, like the
flounders and skates, lie flat on the bottom. Still others retreat to the
shallows or the depths or the rock-pools or to any place safer than
the open sea. Some are protected by spines which they erect when
attacked. Some erect these spines only after they have been
swallowed, tearing the stomach of their enemy and killing it, but too
late to save themselves. Again in some species the spines are armed
with poison which benumbs the enemy. Sometimes an electric
battery about the head or on the sides gives the biting fish a severe
shock and drives him away. Such batteries are found in the electric
rays or torpedo, in the electric eel of Paraguay, the electric catfish of
the Nile, the electric stargazer and other fishes.
Some fishes are protected by their poor and bitter flesh. Some have
bony coats of mail and sometimes the coat of mail is covered with
thorns, as in the porcupine-fish. This fish and various of its relatives
have the habit of filling the stomach with air when disturbed, then
floating belly upward, the thorny back only within reach of its
enemies.

Fig. 118.—The remora, or cling fish, Remoropsis brachyptera. Note sucker on top
of head. (After Goode.)

Many species (cling fishes) attach themselves to the rocks by a fleshy


sucking-disk. Some (Remora) (fig. 118) cling to larger fishes by a
strange sucking-disk on the head, a transformed dorsal fin, being
thus shielded from the attacks of fish smaller than their protectors.
Some small fishes seek the shelter of the floating jellyfishes, lurking
among their poisoned tentacles. Others creep into the masses of
floating gulf-weed. Some creep into the shell of clams and snails. In
the open channel of a sponge, the mouth of a tunicate and in similar
cavities of various animals, little fishes may be found. A few fishes
(hag-fishes) are parasitic on others, boring their way into the body
and devouring the muscles with their rasp-like teeth.
Some fishes are provided with peculiar modifications of the gills
which enable them to breathe for a time out of water. Such fish have
the pectoral fins modified for a rather poor kind of locomotion on
land, thus enabling them to move from pond to pond or from stream
to stream. In cold climates the fishes must either migrate to warmer
latitudes in winter, as some do, or withstand variously the cold, often
freezing weather. Some fish can be frozen solid, and yet thaw out
and resume active living. Some lie at the bottoms of deep pools
through the colder periods, while many others, such as the minnows,
chubs, and other kinds common in small streams, bury themselves in
the mud, and lie dormant or asleep through the whole winter. On the
other hand in countries where the long intense rainless summers dry
up the pools, some fishes have the habit of burying themselves in the
mud, which, with slime from the body, forms about them a sort of
tight cement ball in which they lie dormant until the rains come.
"Thus a lung-fish (called Protopterus), found in Asia and Africa, so
completely slimes a ball of mud around it that it may live for more
than one season, perhaps many; it has been dug up and sent to
England, still enclosed in its round mud-case, and when it was placed
in warm water it awoke as well as ever."
Food-fishes and fish-hatcheries.—Most fishes are suitable for
food, though not all. Some are too small to be worth catching or too
bony to be worth eating. Some of the larger ones, especially the
sharks, are tough and rank. A few are bitter and in the tropics a
number of species feed on poisonous coelenterates about the coral
reefs, becoming themselves poisonous in turn. But a fish is rarely
poisonous or unwholesome unless it takes poisonous food. Where
fishes of a kind specially used for food gather in great numbers at
certain seasons of the year, fishing is carried on extensively and with
an elaborate equipment. Such fisheries, some of which have been
long known, are scattered all over the world. Along the shores of the
Mediterranean Sea, and on the coasts of Norway, France, the British
Isles and Japan are numerous great fishing-places. But "nowhere are
there found such large fisheries as those along the northern Atlantic
coasts of our own continent, extending from Massachusetts to
Labrador. Especially on the banks of Newfoundland are codfish,
herring, and mackerel caught." Among our fresh-water fisheries the
great salmon fisheries of the Penobscot and Columbia rivers and of
the Karluk and other rivers of Alaska are the best known. The
whitefish of our Great Lakes is also one of the important food-fishes
of the world.
In many places fishes are raised in so-called hatcheries, not usually
for immediate consumption but for the purpose of stocking ponds
and streams either in the neighborhood of the hatchery or in distant
waters which the special species cultivated has not been able
naturally to reach. The eggs of some fishes are large and non-
adherent, two features which greatly favor artificial impregnation and
hatching. In the hatcheries the eggs are put first into warm water,
where development begins; they are then removed into cool water,
which arrests development without injury, making shipment possible.
The eggs of salmon and trout in particular can be sent long distances
to suitable streams or ponds. The eggs of the shad have been thus
carried from the East to the streams of California and trout have
been distributed to many streams in our country which by
themselves they could never have reached.
The salmon is a conspicuous example of those fishes which can be
artificially propagated. The eggs of the salmon are large, firm, and
separate from each other. If the female fish be caught when the eggs
are ripe and her body be pressed over a pan of water the eggs will
flow out into the water. By a similar process the milt or male sperm-
cells can be procured and poured over the eggs to fertilize them. The
young after hatching are kept for a few days or weeks in artificial
pools, till the yolk-sacs are absorbed and they can take care of
themselves. They are then turned into the stream, where they drift
tail foremost with the current and pass downward to the sea. All
trout may be treated in similar fashion, but there are many food-
fishes which cannot be handled in this way. In some the eggs are
small or soft, or viscid and adhering in bunches. In others the life-
habits make artificial fertilization impossible. Such species are
artificially reared only by catching the young and taking them from
one stream to another. To this type belong the black bass, the
sunfish, the catfish and other familiar forms.

CHAPTER XXV

BRANCH CHORDATA (Continued). CLASS


BATRACHIA: THE BATRACHIANS
The structure, life-history, and habits of the garden-toad (Bufo
lentiginosus) have already been studied (see Chapter II and Chapter
XII).

OTHER BATRACHIANS.

The class Batrachia includes the animals familiarly known as


cœcilians, sirens, mud-puppies, salamanders, toads, and frogs.
Although differing plainly from fishes in appearance and habits, the
batrachians are really closely related to them, resembling them in all
but a few essential characters. Among the distinctive characters of
batrachians may be noted the absence of fins supported by fin-rays,
the presence usually of well-developed legs for walking or leaping,
and the absence or reduction of certain bones of the head connected
with the gills and lower jaw and which are well developed in the
fishes. The batrachians stand in somewhat intermediate position
between the fishes and the reptiles, showing some of the characters
of both. They are, like fishes and reptiles, cold-blooded. In their adult
condition some are terrestrial and some aquatic as to habitat, but all
have an aquatic larval life. The water-inhabiting young breathe at
first by means of gills, later lungs begin to develop, and for a time
both gills and lungs are used in respiration. Finally in the adult
condition in almost all of the forms the gills are wholly lost and
breathing is done by the lungs and skin solely. Correlated with the
change of habits from larval to adult stage there is usually a well-
marked metamorphosis in post-embryonic development. This
metamorphosis is specially striking among the frogs and toads. None
of the aquatic forms is marine, salt water always killing eggs, larvæ
or adults. Batrachians are found all over the world, although there
are few in the extreme North. They are most abundant in warm and
tropical lands.

Fig. 119.—The tiger salamander. (From Jenkins and Kellogg.)

Body form and organization.—The body varies from a long and


slender, truly snake-like form as in the tropical cœcilians through the
usual salamander (fig. 119) shape, where it is more robust but still
elongate and tailed, to the heavy, squat, tailless condition of the
toads. Legs, with five digits, are usually present, and are used for
swimming, walking, or leaping. The legs are longest and best
developed in the short tailless frog and toad forms which are mostly
terrestrial, and are short and weak in the tailed salamander forms,
many of which are aquatic. The skin is almost always naked, showing
a marked difference from the scaled condition of reptiles and most of
the fishes, and its cells secrete a slimy, sticky, usually whitish fluid,
which in some cases is irritating, or even poisonous. The skin is
sometimes thrown up into folds or ridges, and in some species is
elevated to form a kind of fin on the tail or back. This unpaired fin
differs from the dorsal fin (and other fins) of fishes in not being
supported by rayed processes of the skeleton. There are in some
batrachians traces of an exoskeleton in the presence of scale-like
structures in the skin or in the horny nails on the digits, but these
cases are rare. The skin contains pigment-cells and many of the
batrachians are brilliantly colored and patterned; some of the
pigment is carried by special contractile or expansile cells, the
chromatophores (see account of chromatophores of the
Cephalopoda, p. 256), so that the animal can change its tint and
markings more or less rapidly. All the batrachians possess external
gills in their aquatic larval stage, and in a few forms, as the sirens
and mud-puppies, gills are retained all through life. These gills are
branched folds of the skin abundantly supplied with blood-vessels.
In the organization of the batrachian body the usual vertebrate
characters appear, the body-organs being arranged with reference to
a supporting and protecting internal bony skeleton. The head is
plainly set off from the rest of the body and bears the mouth and the
organs of hearing and sight. Certain so-called lateral sense organs,
the function of which is not exactly known, occur arranged in three
lines on each side of the body of some of the forms. Both pairs of
limbs are present and functional in almost all of the species. In the
cœcilians the limbs are wholly wanting; in the sirens only the fore
legs are present.
Structure.—The most obvious skeletal differences among
batrachians are those due to variations in external form. While there
are as many as 100 vertebræ in some of the elongate long-tailed
salamanders (even 250 in the strange snake-like cœcilians), there are
but 10 (the last or tenth being the rod-shaped bone called the
urostyle) in the short, tailless frogs and toads. To any of the vertebræ
except the first (the single cervical vertebra) and the last, ribs may
be attached and the cœcilians have about as many pairs of ribs as
vertebræ. In the frogs and toads, however, the ribs are lost. In any
case they are never fastened by their lower ends to the breast-bone.
The alimentary canal is usually not much longer than the body and is
plainly divided into mouth, pharynx, œsophagus, small intestine,
large intestine or rectum, and anal opening. The teeth when present
occur on both the jaws and the palate. They are small, sharp, point
backward and are fused to the bones. They are wholly wanting in the
toad and in some other allied forms. The tongue may be wanting, or
may be immovably fixed to the floor of the mouth, or as in the frogs,
fastened at its front end but free behind, so that the hinder end can
be protruded far from the mouth for the purpose of catching insects.
The organs of respiration are gills, external and internal, lungs,
trachea or windpipe, and the skin. In the earliest larval stages all
batrachians have gills; later, in most cases, the gills become reduced
and disappear, while at the same time lungs are developing. In some
salamanders the lungs never develop, but the animals, in their adult
stage, breathe wholly by means of the skin. In a few cases, as in the
siren and mud-puppies, gills are retained through the whole life,
although lungs are also present in the adult stage. The lungs are two
in number, a right and a left lung, and are simple sacs with the walls
more or less folded or thrown into ridges and richly supplied with
blood-vessels. The front end of the lungs opens directly into the
pharynx or, in the more elongate batrachians, is connected with it by
a tubular trachea or windpipe. In the frogs and toads there are vocal
cords stretched across the short windpipe; the vibration of these
cords produces the croaking.
The heart is always three-chambered, consisting of the right and left
auricles and a single ventricle. The circulation of the more
generalized salamanders like the mud-puppies is essentially like that
of a fish. In the frogs and toads there is a distinct advance beyond
this condition. The red corpuscles of the blood are oval in shape and
are the largest found among any of the vertebrates.
In the nervous system the small size of the hindbrain or cerebellum is
noticeable. The sense organs are fairly well developed. The skin of
the whole body is provided with tactile nerve-endings. There are
special taste organs on the lining membrane of the tongue and
mouth-cavity. The eyes have no lids in some of the lower forms;
most of the frogs and toads have an upper lid but no under one,
although a thin membrane, called the nictitating membrane, arises
from the lower margin of the eye and can be drawn up over it. The
ears have no external parts, other than the thin tympanic
membranes. The nostrils of frogs and toads can be closed by the
contraction of certain special muscles.
Life-history and habits.—The sexes are distinct, and in most cases
the young hatch from eggs. A few of the salamanders give birth to
free young. The eggs are usually in strings or chains enclosed in a
clear gelatinous substance; these chains of eggs are either simply
dropped into the water or are fastened to water-plants. The young,
called tadpoles (fig. 120), in their earlier larval stages are extremely
fish-like in character, long-bodied, tailed, swimming freely about by
means of the fin-like flattened tail, and breathing by means of
external gills. Nor do they show any sign of legs. As the tadpoles
grow and develop the legs begin to appear, the hind legs first in the
frogs and toads, the fore legs first in the salamanders; lungs develop
and the gills disappear (except in the cases of the few forms which
retain gills through life). The tail shortens and finally disappears in
the frogs and toads; with the salamanders the tail-fin only is lost. At
the same time the change from water to land is made. Further
growth is very slow; frogs are not really adult, that is, capable of
producing young, until they are five years old, and they may continue
to increase in size until they are ten years old.
Fig. 120.—Tadpoles. (Photograph from life by Cherry Kearton; permission of
Cassel & Co.)

The food of the adult batrachians is almost exclusively small animals,


particularly insects and worms. Crustaceans, snails, and young fish
are also eaten. The tadpoles also eat vegetable matter. Almost all
batrachians are nocturnal in habit, remaining concealed by day. In
the zones in which cold winters occur they hibernate or pass the
winter in a torpid condition, or state of "suspended animation," or, as
it is said, they sleep through the winter. Frogs burrow into the mud at
the bottom of ponds at the approach of winter and come forth early
in the spring to lay their eggs. Most batrachians are very tenacious of
life, being able to withstand long periods of fasting and serious
mutilation, and most of them can regenerate certain lost parts, such
as the tail or legs.
Classification.—The living Batrachia are divided into three orders,
viz., the Urodela, including the sirens, mud-puppies, salamanders,
and newts, batrachians which retain the tail throughout life, having
generally two pairs of limbs of approximately equal size, and
sometimes possessing gills or gill-slits in the adult condition; the
Anura, or frogs and toads, with no tail in the adult condition, with
short and broad trunk, with hind limbs greatly exceeding the fore
limbs in size, and never with gills or gill-slits in the adult stage; and
the Gymnophiona, or cæcilians, snake-like batrachians having neither
limbs nor tail, with a dermal exoskeleton and without gills or gill-slits
in the adult.

Mud-puppies, salamanders, etc. (Urodela).—Technical Note.


—If possible obtain specimens of mud-eels (Siren), common in
the South, or mud-puppies (Necturus), common in the central
North, as examples of batrachians with gills persisting in the
adult stage. One or more species of Amblystoma may be found
in almost any part of the country, and larvæ of large size may be
found with the external gills. For an example of the general long-
tailed or Urodelous type of batrachian any salamander or newt
occurring in the vicinity of the school may be used. The little
green triton or eft (Diemictylus viridiscens) of the eastern States,
or its larger brown-backed congener of the Pacific coast (D.
torosus) is common in water, while another eft, the little red-
backed salamander, (Plethodon) is common in the woods under
logs and stones. The external characters of the body should be
compared with those of the toad. The skeleton should be
prepared by macerating away the flesh (for directions, see p.
452), and the presence of the many caudal vertebræ and the
ribs, the equality in size of the legs, and other points should be
noted. Compare with skeleton of toad. Make drawings. It will be
well, also, to dissect out and examine the various internal organs
of the salamander, comparing them with the same organs in the
toad. The salamander, indeed, is in many ways better than the
toad as an example of the class. Its body is less adaptively
modified and shows the essentially fish-like character of the
batrachian structure.
The batrachians which retain external gills in the adult stage are the
members of two families of which the American representatives are
known as mud-eels (Siren) and mud-puppies or water-dogs
(Necturus). The mud-eels, which are found "in the ditches in the
swamps of the southern States from South Carolina to the Rio
Grande of Texas and up the Mississippi as high as Alton, Illinois," are
blackish in color, have no hind legs and are long and slender, with the
tail shorter than the rest of the body. They reach a length of nearly
three feet. The mud-puppies, found in the Great Lakes and in the
rivers of the upper Mississippi valley, are brown with colored spots,
and are about two feet long when full grown. They have both fore
and hind legs.
A few salamanders, while not possessing external gills when adult,
have a spiracle or small circular opening in the side of the neck which
leads into the throat. The best-known American salamander of this
kind is the large heavy-bodied blackish water-dog or "hellbender"
(Cryptobranchus) of the Ohio River. It is about two feet long, and is
"a very unprepossessing but harmless creature." It has a conspicuous
longitudinal fold of skin along each side of the body. The largest
known batrachian, the giant salamander of Japan (Megalobatrachus),
reaching a length of three feet, is related to the water-dog.
Of all the salamanders the most interesting are the blunt-nosed
salamanders (Amblystoma). A dozen or more species of Amblystoma
occur in North America, of which tigrinum, a dark-brown species with
many irregular yellow blotches sometimes arranged in cross-bands, is
the most widespread. The larvæ of some Amblystoma retain their
gills until they have reached a large size, and in one or two species
the usual metamorphosis is very long delayed and the salamanders
produce young while in the larval condition, that is, while retaining
the gills and a compressed fin-like tail. In the case of a certain
Mexican species (A. maculatum) it is believed that the final
metamorphosis never occurs. The Mexicans call these gilled larval
Amblystoma axolotls, and use them for food. For a long time
naturalists supposed the Amblystoma larvæ which produce young to
be the adults of a species of salamanders which retained their gills
through life, like the sirens and mud-puppies, and classified them in a
distinct genus.

Fig. 121.—The Western brown eft, or salamander, Diemyctylus torosus. (From


living specimen.)

Of the various common salamanders or newts some are found in


streams, ponds, and ditches, and some under logs and stones in the
woods. The aquatic forms have the tail compressed (flattened from
side to side), while the land forms have the tail cylindrical, tapering
to a point. Most of the land-salamanders produce their young alive,
while the water forms lay eggs which are usually attached to a
submerged plant-stem. The salamanders are, almost without
exception, found only in the northern hemisphere.
Frogs and toads (Anura).—There are about a dozen species of
frogs in the United States. The largest of these, and indeed the
largest of all the frogs, is the well-known bullfrog (Rana catesbiana),
which reaches a length (head to posterior end of body) of eight
inches. It is found in ponds and sluggish streams all over eastern
United States and in the Mississippi valley. It is greenish in color with
the head usually bright pale green. Its croaking is very deep and
sonorous. The pickerel-frog (R. palustris), which is bright brown on
the back with two rows of large oblong square blotches of dark
brown on the back, is found in the mountains of eastern United
States. The little pale reddish-brown wood-frog (R. sylvatica) with
arms and legs barred above is common in damp woods and is "an
almost silent frog." The peculiar and infrequently seen frogs known
as the "spade-foots" (Scaphiopus) are subterranean in habit and
usually live in dry fields or even on arid plains and deserts. They pass
through their development and metamorphosis very rapidly,
appearing immediately after a rain and laying their eggs in temporary
pools. At this time of egg-laying they utter extraordinarily loud and
strange cries. Some frogs in other parts of the world live in trees, and
the eggs of one species are deposited on the leaves of trees, leaves
which overhang the water being selected so that the issuing young
may drop into it.
The true tree-frogs or tree-toads (Hylidæ) constitute a family
especially well represented in tropical America. They have little disk-
or pad-like swellings on the tips of their toes to enable them to hold
firmly to the branches of the trees in which they live. Some, like the
swamp tree-frog and the cricket-frog, are not arboreal in habit,
remaining almost always on the ground. The common tree-frog of
the eastern States (Hyla versicolor) is green, gray, or brown above
with irregular dark blotches, and yellow below. It croaks or trills,
especially at evening and in damp weather. Pickering's tree-frog (Hyla
pickeringii) makes the "first note of spring" in the eastern States.
This tree-frog is the one most frequently heard in the autumn too,
but "its voice is less vivacious than in the spring and its lonely pipe in
dry woodlands is always associated with goldenrods and asters and
falling leaves." The tree-frogs of North America lay their eggs in the
water on some fixed object as an aquatic plant, in smaller packets
than those of the true frogs, and not in strings as do the toads.
The toads (Bufonidæ) differ from the true frogs in having no teeth
and in not having, as the frogs do, a cartilaginous process uniting the
shoulder-bones of the two sides of the body. The absence of this
uniting process makes the thoracic region capable of great
expansion. There are only a few species of toads in North America,
but one of these species, the common American toad (Bufo
lentiginosus), is very abundant and widespread. It appears also in
two or three varieties, the common toad of the southern States
differing in several particulars from that of the northern. The toad is
a familiar inhabitant of gardens, and does much good by feeding on
noxious insects. It is most active at twilight. Its eggs are laid in a
single line in the centre of a long slender gelatinous string or rope,
which is nearly always tangled and wound round some water-plant or
stick near the shore on the bottom of a pond. The eggs are jet black
and when freshly laid are nearly spherical. At the time of egg-laying
the toads croak or call, making a sort of whistling sound and at the
same time pronouncing deep in the throat "bu-rr-r-r-r." The toad
does not open its mouth when croaking, but expands a large sac or
resonator in its throat. The toad-tadpoles are blacker than those of
frogs or salamanders, and undergo their metamorphosis while of
smaller size than those of frogs. When they leave the water they
travel for long distances, hopping along so vigorously that in a few
days they may be as far as a mile from the pond where they were
hatched. They conceal themselves by day, but will appear after a
warm shower; this sudden appearance of many small toads
sometimes gives rise to the false notion that they have fallen with
the rain.
Cœcilians (Gymnophiona).—The third order of batrachians, the
cœcilians, includes about twenty species of slender worm- or snake-
like limbless forms which are confined to the tropics. Some of them
are wholly blind and the others have only rudimentary eyes. In them
the skin is folded at regular intervals so that the body appears to be
rigid or segmented, and in some species there are small concealed
horny scales in the skin.

CHAPTER XXVI

BRANCH CHORDATA (Continued). CLASS


REPTILIA: THE SNAKES, LIZARDS, TURTLES,
CROCODILES, ETC.
THE GARTER SNAKE (Thamnophis sp.)
Technical Note.—Garter snakes may be found almost anywhere
during the spring and summer months. If possible each student
should have a specimen, but in case it is difficult to get enough
snakes two students can use a single specimen. If garter snakes
are rare, take any other snake. Snakes will live a long time
without feeding and specimens should be kept alive until ready
to use. Kill with chloroform as directed for the toad (p. 5). After
completing the study of the external characters place each
specimen in a dissecting-pan and with a pair of scissors cut
through the scales on the ventral side, passing backwards from
the eighteenth to the fortieth. Pin back the edges of the cut and
thus expose the heart. Through its lower end, the ventricle,
insert a large canula; inject with a fairly large syringe the glue
mass which is described on p. 452. This injection will fill the
entire arterial system. To inject the venous system make another
cut through the ventral scales, cutting forward from the anal
scale through about forty of them. Note the injected mass in
some of the vessels already filled. Take one of the large vessels
still containing blood and pass two ligatures beneath it. Get
ready a small canula and cut a slit in the vessel, elevating the
head so that the blood will run out as much as possible. Now
wash the blood off, insert the canula in the slit and tie one
ligature about the vessel containing the canula; have the other
ready to tie after the vein has been injected. Use a new color for
the venous system. Leave specimen in cold water for a time until
the injection is hard. Then continue the cut from the anal plate
forward to the lower jaw and pin out the edges of the cut on
both sides in the dissecting-pan.

Structure (fig. 122).—Note that the snake is covered with horny


scales somewhat as the fish is. How do these scales differ from those
of the fish? In snakes the scales are not bony, but are true skin
structures. Note the modification of the scales on the head, back,
and ventral surface. Those on the dorsal surface often have minute
ridges, the keels. How do the ventral scales differ from the dorsal
ones and others? By a system of muscles these ventral scales are
rhythmically moved and as their posterior edges are pushed back
against some resisting object the body glides forward. On the head
note the pair of eyes. Are there eyelids? In front of each eye note an
opening. What are these openings? Thrust a bristle into the opening
and see where it enters the mouth-cavity through the internal nares.
Does the snake have external ears? Observe the very long jaws and
note that they are loosely hinged. Examine the inside of the mouth.
Are there teeth? If so where are they situated, and how arranged?
Note that all of the teeth point backwards. Food is not chewed. When
some object of prey, a frog, or mouse, for example, is seized, the
teeth hold it fast to the roof of the mouth and by a backward and
forward movement of the lower jaws it is gradually drawn into the
large œsophagus. What is the character and situation of the tongue?
Just behind the tongue note the narrow slit, glottis, opening into the
windpipe, or trachea. Back of the trachea opens the œsophagus.
When the snake is laid open the elongate heart will be conspicuous
in the anterior third of the body. Insert a blowpipe or quill into the
glottis just back of the tongue, and inflate the lung, which is a long,
thin-walled bag extending from the region of the heart posteriorly for
two-thirds of the length of the body. There is but one developed
lung, the right; note at the anterior end of the lung a small mass of
tissue, the atrophied left lung. Running forward from the lung is a
long tube composed of incomplete cartilaginous rings, connected by
membrane, the trachea. Note the long straight alimentary canal.
Distinguish the œsophagus, stomach, intestine, rectum and the anus.
In the region of the lung is an elongated dark-red glandular mass,
the liver. The secretion from the liver passes down through the long
hepatic duct to the oval-shaped green gall-bladder and into the
intestine.

Technical Note.—The bile-duct may be injected through the gall-


bladder with some colored injecting mass.

Note that the duct running off from the gall-bladder to the intestine
passes through a pink glandular organ, the pancreas. At the anterior
end of the pancreas is a dark-red nodular structure, the spleen. The
alimentary canal, the liver and the spleen are all suspended from the
dorsal wall of the body-cavity by a delicate sheet of tissue. What is
this? This condition we have also noted in the toad and fish.
Toward the posterior end of the body cavity are two long, dark-red
glands, the kidneys, which are the principal excretory organs of the
body. Through a long, slender tube (the ureter) each of the kidneys
passes off its wastes. Where do the ureters open?
Anterior to the kidneys are the reproductive organs. The eggs,
produced by the female snake, after being fertilized, pass backward
through the egg-tubes. During the breeding season these tubes are
much distended. This is due to the presence of the developing eggs,
for the young snakes are hatched in the egg-tubes.
A successful injection as directed in the first technical note will have
filled both arterial and venous systems. How does the general shape
of the snake's heart compare with that of the toad? The heart
consists of two ventricles, incompletely separated, and two auricles.
In the snake the conus arteriosus is very much shortened and is not
visible. Note two large vessels arising from the median portion of the
ventricle. The one on the left side is the left aortic artery or left aortic
arch, while the right gives off two branches. Where does the anterior
one of these run? The main branch, or right aortic arch, passes back
to meet its fellow, the left aortic artery, forming with it the dorsal
aorta, which runs posteriorly to the end of the tail. Note the various
branches given off by the dorsal aorta and trace some of them.
Arising from the ventricles beneath the two aortic arches is the
pulmonary artery, which goes to the lung. There the blood is
purified, after which it is taken up by the pulmonary vein and carried
back to the left auricle, whence it passes into the ventricle to be
mixed with the impure blood from the right auricle. From the arteries
the blood flows to all parts of the body through fine capillaries,
bathing the tissues, giving off oxygen and taking up the carbonic acid
gas. From these capillaries it passes into veins and so back to the
heart; from the anterior end of the body through the jugular veins
and from the posterior portion of the body through the postcaval
vein. Flowing forward from the tail in the caudal vein, the blood
enters the capillaries of the kidneys, where the waste matter is taken
from it. This part of the circulatory system is known as the renal-
portal circulation. From the kidneys the blood flows through the
postcaval vein anteriorly to the heart.
The blood which passes out from the dorsal aorta to all parts of the
alimentary canal is again collected into veins which unite to form the
mesenteric vein. This vein runs to the liver, where it breaks up into
capillaries. Thence the blood is carried into the postcaval vein, which
leads directly to the heart. This part of the circulatory system which
collects blood from the alimentary canal and carries it to the liver is
called the hepatic-portal system.
Just in front of the heart will be noted a nodular structure, the
thyroid gland, while a little in advance of the thyroid may be seen a
long glandular mass, the thymus gland. The functions of these
glands are not certainly understood.
Remove the alimentary canal and muscles from a part of the body
and note that the axial skeleton, like that of the other vertebrates
studied, consists of a series of vertebræ placed end to end. Are there
arms or legs? Are shoulder and pelvic girdles present? How many of
the vertebræ bear ribs? The ribs connect at their lower ends with the
ventral scales. Note the great number of the vertebræ and ribs as
compared with those of the toad or fish. What are those vertebræ
called which bear no appendages or ribs? Examine carefully the
elongated skull of the snake, especially the modified jaws. A detailed
study of the skeleton may be made by referring to the account of the
skeleton of the lizard in Parker's "Zootomy," pp. 130 et seq.
The nervous system may be worked out in a specimen which has
been immersed in 20 per cent nitric acid. The description of the
nervous system of the toad (see pp. 12-13) will suffice for a guide to
the study of the nervous system of the snake. The special sense
organs, as eyes and ears, should be examined and compared with
those of the fish and toad.
Life-history and habits.—The garter snakes are more or less
aquatic in habit and are good swimmers. They are often found far
from water, but in greatest abundance where the cat-tails and rushes
grow thickest. They feed on frogs, salamanders, and field-mice,
which they swallow whole. All the garter snakes are ovoviviparous,
i.e., hatch eggs within the body-cavity. The eggs, often as many as
eighteen or twenty, are enclosed within widened portions of the
oviducts during embryonic existence; when the young are born they
are able to shift for themselves. During cold weather the garter
snake hibernates, hiding then in some gopher-hole, or, in the warmer
climates, under some log or stone, there to lie dormant until the
warm days of spring come, when it resumes activity.
The garter snake sheds its skin at least once a year, sometimes
oftener. This process may be observed in snakes kept in confinement.
For some time before molting the animal remains torpid, the eyes
become milky, and the skin loses its lustre. After a few days it
conceals itself, the skin about the lips and snout pulls away and the
animal slips out of its entire skin. The snake not only sheds the skin
of the body but also the covering of the eyes. Snakes have no
eyelids, as we have already noted, that which represents the eyelid
being a transparent membrane which covers the eyeball.
No species of the garter snake group is poisonous. Sometimes a
garter snake may appear to be vicious, but its teeth are very short
and at best it can only make a small scratch scarcely piercing the
skin.
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like