Java Reference
In-Depth Information
C H A P T E R 9
Interacting with Networks and Databases
Youhavethreetargetsforaccessingdatathat'sexternaltoanapplication:filesystem,net-
work,anddatabase. Chapter8 introducedyoutofilesystem-orienteddataaccess,whereas
this chapter introduces you to data access via networks and databases.
Interacting with Networks
A network isacollectionofinterconnected nodes (computersandperipherals[e.g.,print-
ers])thatcansharehardwareandsoftwareamongusers.An intranet isanetworkwithin
anorganizationandan internet isanetworkthatlinksorganizationstogether.The Inter-
net is the global network of networks.
Note IntranetsandinternetstypicallyuseTransmissionControlProtocol(TCP),User
Datagram Protocol (UDP), and Internet Protocol (IP) to communicate between nodes.
TCP is a two-way communication protocol, UDP is a one-way communication pro-
tocol,andIPisthefundamentalcommunicationprotocoloverwhichTCPandUDPper-
form their communication tasks. TCP, UDP, and IP are combined with other protocols
into a model known as TCP/IP (see http://en.wikipedia.org/wiki/TCP/
IP_model ) .
The java.net packagesuppliesassortedclassesthatsupportTCP/IPcommunication
between processes (executingapplications)thatarerunningonthesameordifferent hosts
(computer-basedTCP/IPnodes).Afterintroducingyoutoeachoftheseclasses,thissec-
tion presents authentication and cookie management.
Communicating via Sockets
A socket isanendpointinacommunicationslinkbetweentwoprocesses.Theendpoint
consistsofan IP address ,whichidentifiesahost,anda port number ,whichidentifiesa
process running on that network node.
Search WWH ::




Custom Search