Documente online.
Zona de administrare documente. Fisierele tale
Am uitat parola x Creaza cont nou
 HomeExploreaza
upload
Upload




Network programming

computers


Network programming

Questions

  1. Explain the following concepts: server, client, internet address, port and socket.
  2. Write a short program to get the IP 24524x231y address of the local host.
  3. What is a stream? Explain and give a short example (java code) of working with sockets as stream.
  4. Write a small server that listens on a port supplied as a parameter in the command line, and exits once a client connects.
  5. How can you threat multiple clients in a Socket based distributed application?
  6. What is the difference between TCP and UDP? Give examples of when to use TCP and when UDP. Name java classes that we must use in order to work with TCP, respectively with UDP.


Problems

  1. Write a simple distributed application with a server and a single client that sends lines of text (from the user input) to the server, and the server returns the reversed line back to the client (where it must be displayed).
  2. Write a distributed application with a server and multiple clients that implements the following communication protocol:

Client: "ping"

Server: "pong"

Client: "who's there?"

Server: "I am the server"

Server: "who are you?"

Client: "I am the client"

  1. Write a chat program that supports multiple clients (all clients can see all messages).
  2. Write an application that allows remote computers to get the atomic time from a time server. Bonus: implement a mechanism to determine the delays in the network.

RMI

Questions

  1. Which is the basic principal difference between the RPC (Remote Procedure Call) and RMI?
  2. Which is the difference between the methods Naming.bind and Naming.rebind?
  3. It is possible to start programmatically the registry? If yes, which is the difference between starting it manually and starting it programmatically?
  4. If the client of a RMI object is on another machine then where the object runs, the stub and skeleton codes where will run?
  5. What is wrong in the next remote interface definition:

public interface PerfectTimeI extends Remote ///:~

Problems

  1. Write a code snippet for a client side lookup of an arbitrary remote interface.
  2. Write the remote interface and the implementation class for a remote object which provides the possibility to authorize a user using and id and password, also provide the registration code of the remote object. The authorization should succeed always for simplicity.

JDBC

Questions

  1. What does the JDBC database URL specify?
  2. Please describe the necessary steps to be done in order to execute and process a SQL query in java.
  3. Enumerate some advantages of the JDBC technology?
  4. Which are the difference between JDBC-ODBC and JDBC driver?
  5. Please describe the role of connection-pooling.
  6. Please enumerate some advantages and disadvantages of the PrepareStatement.
  7. What is the difference between Statement and CallableStatement?
  8. Explain when should we use each of the following methods of Statement interface:
    1. executeUpdate
    2. executeQuery
    3. executeBatch

Problems

  1. Create a class that opens a connection to a database using JDBC_ODBC bridge.
  2. Write a java class that inserts into a database table (let say Users[FirstName,LastName,Email]) n records using PreparedStatement interface.
  3. For a database with the following structure, write a class that displays all students for a given department of a university.

  1. Write a class which opens a JDBC-ODBC connection to a given data base, read all records of a table (Persons[name, address, email, age]) and display them ordered by name.
  2. Suppose that we have 2 tables with the same structure within a given database. Write a java class that allows you to copy all data from one table to other. Table should be given as execution arguments.

Table structure:

o       id: int

o       name: varchar

o       price: int


Document Info


Accesari: 1453
Apreciat: hand-up

Comenteaza documentul:

Nu esti inregistrat
Trebuie sa fii utilizator inregistrat pentru a putea comenta


Creaza cont nou

A fost util?

Daca documentul a fost util si crezi ca merita
sa adaugi un link catre el la tine in site


in pagina web a site-ului tau.




eCoduri.com - coduri postale, contabile, CAEN sau bancare

Politica de confidentialitate | Termenii si conditii de utilizare




Copyright © Contact (SCRIGROUP Int. 2024 )