Java DB

Apache Derby

Derby Developer's Guide

Derby Getting Started
Derby Reference Manual
Derby Developer's Guide
Derby Performance Tuning
Derby Server and Admin Guide
Derby Tools and Utilities
Derby Developer's Guide
-After installing
-Upgrades
-JDBC applications and Derby basics
-Application development overview
-Derby embedded basics
-Derby JDBC driver
-Derby JDBC database connection URL
-Derby system
-A Derby database
-Connecting to databases
-Working with the database connection URL attributes
-Using in-memory databases
-Working with Derby properties
-Deploying Derby applications
-Deployment issues
-Creating Derby databases for read-only use
-Loading classes from a database
-Derby server-side programming
-Programming database-side JDBC routines
-Programming trigger actions
-Programming Derby-style table functions
-Programming user-defined types
-Controlling Derby application behavior
-The JDBC connection and transaction model
-Result set and cursor mechanisms
-Locking, concurrency, and isolation
-Working with multiple connections to a single database
-Working with multiple threads sharing a single connection
-Working with database threads in an embedded environment
-Working with Derby SQLExceptions in an application
-Using Derby as a J2EE resource manager
-Derby and Security
-Configuring security for your environment
-Working with user authentication
-Users and authorization identifiers
-User authorizations
-Encrypting databases on disk
-Signed jar files
-Notes on the Derby security features
-User authentication and authorization examples
-Running Derby under a security manager
-Developing tools and using Derby with an IDE
-SQL tips
-Localizing Derby
-Derby and standards

 

Deployment options and threading and connection modes

A database can be available to multiple connections in several situations.

  • Multiple applications access a single database (possible only when Derby is running inside a server framework).
  • A single application has more than one Connection to the same database.

    The way you deploy Derby affects the ways applications can use multi-threading and connections, as shown in Threading and Connection Modes.

    Table 1. Threading and Connection Modes
    Connection mode Embedded Server

    Multi-Threaded

    From an application, using a single Connection to a Derby database and issuing requests against that connection in multiple threads.

    Supply a single Connection object to separate threads. Derby ensures that only one operation is applied at a time for consistency. Server frameworks automatically manage multi-threaded operations.. Server frameworks can automatically multi-thread operations. Remote client applications can multi-thread if desired.

    Multi-Connection

    From an application, using multiple connections to a Derby database and issuing requests against those connections on multiple threads.

    Create individual connections within a single application and use the appropriate connection for each JDBC request. The connections can all be to the same database, or can be to different databases in the same Derby system. Remote client applications can establish the multiple connections desired.

    Multi-User

    Multiple applications (or JVMs) accessing the same Derby database. Each user application has its own connection or connections to the database.

    Not possible. Only one application can access a database at a time, and only one application can access a specific system at a time. When using a pre-1.4 JVM, Derby might not prevent multiple applications from concurrently accessing the same Derby system, but do not allow this because such access can corrupt the databases involved. Only one server should access a database at a time. Multiple remote client applications can access the same server, and thus can access the same database at the same time through that server.
 

javadb@jdbcurl.com