Description: This Derby Network Server sample program demonstrates how to obtain an embedded connection and client connections to the same database by using the Network Server. This program shows how to use either the DriverManager or a DataSource to obtain client connections.
Keywords: Network Server, sample programs for embedded and client connections

# Network Server sample programs for embedded and client connections

This Derby Network Server sample program demonstrates how to obtain an embedded connection and client connections to the same database by using the Network Server. This program shows how to use either the DriverManager or a DataSource to obtain client connections.

For a database to be consistent, only one JVM can access it at a time. The embedded driver is loaded when the Network Server is started. The JVM that starts the Network Server can obtain an embedded connection to the same database that the Network Server is accessing to serve clients from other JVMs. This solution provides the performance benefits of the embedded driver and also allows client connections from other JVMs to connect to the same database.

- Overview of the SimpleNetworkServerSample program
- Running the SimpleNetworkServerSample program
- Connecting a client to the Network Server with the SimpleNetworkClientSample program
- Running the SimpleNetworkClientSample program

Parent topic: Derby Network Server sample programs
Related reference
The NsSample sample program