Quick start guide for experienced JDBC users
Getting Started with Derby
37
Quick start guide for experienced JDBC users
This section is for experienced JDBC programmers who already know how to set the
classpath, how to run a Java program, and how to use a JDBC driver.
For more detailed information on the topics covered in this section, see the Derby
Developer's Guide and the Derby Tools and Utilities Guide.
Environments in which Derby can run
Before you configure your system to run Derby, it is useful to understand something
about the different environments in which Derby can run, because these environments
affect the classpath, driver name, and database connection URL.
See the Derby Developer's Guide for more information on Derby environments.
Embedded environment
An embedded environment is an environment in which only a single application can
access a database at one time, and no network access occurs.
When an application starts an instance of Derby within its JVM, the application runs in an
embedded environment. Loading the embedded driver starts Derby.
Client/server environment
A client/server environment is an environment in which multiple applications connect to
Derby over the network.
Derby runs embedded in a server framework that allows multiple network connections.
(The framework itself starts an instance of Derby and runs in an embedded environment.
However, the client applications do not run in the embedded environment.)
You can also embed Derby in any Java server framework.
See the Derby Server and Administration Guide for more information on how to run
Derby on a server.
Available drivers
Different JDBC drivers are available depending on the environment you choose for
Derby.
· org.apache.derby.jdbc.EmbeddedDriver
A driver for embedded environments, when Derby runs in the same JVM as the
application.
· org.apache.derby.jdbc.ClientDriver
A driver for the Network Server environment. The Network Server sets up a
client/server environment.
Database connection URL
You must use a database connection URL when using the Derby-provided embedded
driver to connect to a database.