This activity uses Derby within a client/server configuration by using the Network Server. The ij tool is the client application that connects to the Derby Network Server. In this activity, you create a database called seconddb and run some basic SQL statements.
You use two command windows (referred to as Shell-1 and Shell-2) in this activity. You use Shell-1 to start the Derby Network Server and display Network Server messages. You use Shell-2 to establish a client connection to the Network Server using ij and then perform some basic SQL operations.
The client connection URL contains network information (hostname and portnumber) not found in the URL for an embedded connection. This information tells the client driver the location of the Network Server. The client driver sends requests to and receives responses from the Network Server.
In this activity the Derby database engine is embedded in the Network Server and returns data to the ij client (a client/server configuration). In contrast, establishing a connection using an embedded URL (one without //localhost:1527/) would have caused the Derby engine to be embedded in the ij application (an embedded configuration).
Apache Derby Network Server - 10.2.2.0 - (485682) started and ready to accept connections on port 1527 at 2007-05-04 20:04:33.511 GMT ... Database engine messages not shown ... 2007-05-04 20:08:43.883 GMT: Shutting down instance c013800d-010f-82e9-fa03-00000011f280
In this configuration, multiple client programs can connect to the Network Server and access the database simultaneously. (This activity does not demonstrate this capability.)