apache > db
Apache DB Project
Font size:      

Derby JDBC Database Connection URL

Derby JDBC Database Connection URL

A Java application using the JDBC API establishes a connection to a database by obtaining a Connection object. The standard way to obtain a Connection object is to call the method DriverManager.getConnection, which takes a String containing a connection URL (uniform resource locator). A JDBC connection URL provides a way of identifying a database. It also allows you to perform a number of high-level tasks, such as creating a database or shutting down the system.

An application in an embedded environment uses a different connection URL from that used by applications using the Derby Network Server in a client/server environment. See the Derby Server and Administration Guide for more information on the Network Server.

However, all versions of the connection URL (which you can use for tasks besides connecting to a database) have common features:

  • you can specify the name of the database you want to connect to
  • you can specify a number of attributes and values that allow you to accomplish tasks. For more information about what you can specify with the Derby connection URL, see "Examples". For detailed reference about attributes and values, as well as syntax of the database connection URL, see the "Derby Database Connection URL Syntax" in the Derby Reference Manual.

An example use of the connection URL:

Connection conn=DriverManager.getConnection("jdbc:derby:sample");

Previous Page
Next Page
Table of Contents