# Overview

The following example scenarios show you how to obtain an embedded connection and client connections using the Network Server to connect to the same database.

An embedded connection is a connection to a database that is booted in the same JVM as the application. This connection can be obtained after the Derby Embedded driver is booted. The URL prefix is jdbc:derby:

Client applications that require a database connection across the network use the network server protocol (DRDA) to connect to the Network Server. This type of connection is referred to as a client connection. The URL prefix is jdbc:derby:net:

- First scenario: Simple Network Server Sample

  This example uses two programs to illustrate how a typical client program that starts up in its own JVM can connect to the Network Server that the server program starts. The client program (SimpleNetworkClientSample) and the server program (SimpleNetworkServerSample) each run in their own (different) JVMs. The example shows the Derby jar files that are needed at the client side and server side to use the Network Server. The SimpleNetworkClientSample program also shows how to use the DriverManger or a DataSource to obtain client connections.

- Second scenario: Network Server Demo

  This example program (NsSample) starts the network server and shows how to obtain client and embedded connections using the Network Server to connect to the same database, all in one JVM.