Java Reference
In-Depth Information
After creating a cookie manager and invoking
setCookiePolicy()
to set the
cookie manager's policy to accept all cookies,
ListAllCookies
installs the cookie
manager as the system-wide cookie handler. It next connects to the domain identified
by the command-line argument and reads the content (via
URL
's
Object getCon-
tent()
method).
Thecookiestoreisobtainedvia
getCookieStore()
andusedtoretrieveallnon-
expiredcookiesviaits
List<HttpCookie> getCookies()
method.Foreachof
these
java.net.HttpCookie
s,
String getName()
,
String getValue()
,
and other
HttpCookie
methods are invoked to return cookie-specific information.
The following output resulted from invoking
java ListAllCookies
ht-
Name = frontend
Value = tk95grc7tko42ghghu3qcep5l6
Lifetime (seconds) = 29985
Path = /
Note
For more information about cookie management, including examples that
show you how to create your own
CookiePolicy
and
CookieStore
imple-
mentations, check out
The Java Tutorial
's “Working With Cookies” lesson (
ht-
index.html
)
.
Interacting with Databases
collectionofdata.Althoughtherearemanykindsofdatabases(e.g.,hierarchical,object-
oriented,andrelational),
relational databases
,whichorganizedataintotablesthatcan
be related to each other, are common. (Each table row stores a single item, such as an
employee, and each column stores a single item attribute, such as an employee's name.)
Exceptforthemosttrivialofdatabases(e.g.,
Chapter8
'sflatfiledatabase),databases
are created and managed through a
database management system
(DBMS). Relational
DBMSes (RDBMSes) support
Structured Query Language
(SQL) for working with
tables and more.
Note
Forbrevity,Iassumethatyou'refamiliarwithSQL.Ifnot,youmightwantto
for an introduction.