• Copyright
  • License
  • About this guide
    • Purpose of this guide
    • Audience
    • How this guide is organized
  • After installing
    • The installation directory
      • Batch files and shell scripts
    • Derby and JVMs
    • Derby libraries and classpath
    • UNIX-specific issues
      • Configuring file descriptors
      • Scripts
  • Upgrades
    • Preparing to upgrade
    • Upgrading a database
    • Soft upgrade limitations
  • JDBC applications and Derby basics
    • Application development overview
    • Derby embedded basics
      • Derby JDBC driver
      • Derby JDBC database connection URL
      • Derby system
        • One Derby instance for each Java Virtual Machine (JVM)
        • Booting databases
        • Shutting down the system
        • Defining the system directory
        • The error log
        • derby.properties
        • Double-booting system behavior
        • Recommended practices
      • A Derby database
        • The database directory
        • Creating, dropping, and backing up databases
        • Single database shutdown
        • Storage and recovery
        • Log on separate device
        • Database pages
        • Database-wide properties
        • Derby database limitations
      • Connecting to databases
        • Connecting to databases within the system
        • Connecting to databases outside the system directory
        • Conventions for specifying the database path
        • Special database access
          • Accessing databases from the classpath
          • Accessing databases from a jar or zip file
        • Database connection examples
      • Working with the database connection URL attributes
        • Using the databaseName attribute
        • Shutting down Derby or an individual database
        • Creating and accessing a database
        • Providing a user name and password
        • Creating a database with territory-based collation
        • Specifying attributes in a properties object
    • Using in-memory databases
    • Working with Derby properties
      • Properties overview
        • Scope of properties
        • Persistence of properties
        • Precedence of properties
          • Protection of database-wide properties
        • Dynamic versus static properties
      • Setting Derby properties
        • Setting system-wide properties
          • Changing the system-wide properties programmatically
          • Changing the system-wide properties by using the derby.properties file
          • Verifying system properties
        • Setting database-wide properties
        • Setting properties in a client/server environment
        • Making dynamic or static changes to properties
      • Properties case study
  • Deploying Derby applications
    • Deployment issues
      • Embedded deployment application overview
      • Deploying Derby in an embedded environment
        • Embedded systems and properties
    • Creating Derby databases for read-only use
      • Creating and preparing the database for read-only use
      • Deploying the database on the read-only media
      • Transferring read-only databases to archive (jar or zip) files
      • Accessing a read-only database in a zip/jar file
      • Accessing databases within a jar file using the classpath
        • Connecting to databases with ambiguous paths to databases in the file system
        • Connecting to databases when the path is ambiguous because of databases in the classpath
      • Databases on read-only media and DatabaseMetaData
    • Loading classes from a database
      • Class loading overview
        • Create jar files for your application
        • Add the jar file or files to the database
          • Jar file examples
            • Installing jar files
            • Removing jar files
            • Replacing jar files
        • Enable database class loading with a property
        • Code your applications
      • Dynamic changes to jar files or to the database jar classpath
        • Requirements for dynamic changes
        • Notes on dynamic changes
  • Derby server-side programming
    • Programming database-side JDBC routines
      • Database-side JDBC routines and nested connections
        • Requirements for database-side JDBC routines using nested connections
      • Database-side JDBC routines using non-nested connections
        • Invoking a procedure using the CALL command
      • Database-side JDBC routines and SQLExceptions
      • User-defined SQLExceptions
    • Programming trigger actions
      • Trigger action overview
      • Performing referential actions
      • Accessing before and after rows
      • Examples of trigger actions
      • Triggers and exceptions
        • Aborting statements and transactions
    • Programming Derby-style table functions
      • Overview of Derby-style table functions
        • Preferred getXXX() methods for Derby-style table functions
      • Example Derby-style table function
      • Writing restricted table functions
      • Optimizer support for Derby-style table functions
        • Measuring the cost of Derby-style table functions
        • Example VTICosting implementation
    • Programming user-defined types
  • Controlling Derby application behavior
    • The JDBC connection and transaction model
      • Connections
        • Statements
        • ResultSets and Cursors
        • Nested connections
      • Transactions
        • Transactions when auto-commit is disabled
        • Using auto-commit
        • Turning off auto-commit
        • Explicitly closing Statements, ResultSets, and Connections
        • Statement versus transaction runtime rollback
        • Using savepoints
    • Result set and cursor mechanisms
      • Simple non-updatable result sets
      • Updatable result sets
        • Requirements for updatable result sets
        • Forward only updatable result sets
        • Scrollable updatable result sets
        • Inserting rows with updatable result sets
        • Naming or accessing the name of a cursor
        • Extended updatable result set example
      • Result sets and auto-commit
      • Scrollable result sets
      • Holdable result sets
        • Holdable result sets and autocommit
        • Non-holdable result set example
    • Locking, concurrency, and isolation
      • Isolation levels and concurrency
      • Configuring isolation levels
      • Lock granularity
      • Types and scope of locks in Derby systems
        • Exclusive locks
        • Shared locks
        • Update locks
        • Lock compatibility
        • Scope of locks
        • Notes on locking
      • Deadlocks
        • Avoiding deadlocks
        • Deadlock detection
        • Lock wait timeouts
        • Configuring deadlock detection and lock wait timeouts
        • Debugging Deadlocks
        • Programming applications to handle deadlocks
    • Working with multiple connections to a single database
      • Deployment options and threading and connection modes
      • Multi-user database access
      • Multiple connections from a single application
    • Working with multiple threads sharing a single connection
      • Pitfalls of sharing a connection among threads
      • Multi-thread programming tips
      • Example of threads sharing a statement
    • Working with database threads in an embedded environment
    • Working with Derby SQLExceptions in an application
      • Information provided in SQL Exceptions
        • Example of processing SQLExceptions
  • Using Derby as a Java EE resource manager
    • Classes that pertain to resource managers
    • Getting a DataSource
    • Shutting down or creating a database
  • Derby and security
    • Configuring security for your environment
      • Configuring security in a client/server environment
      • Configuring security in an embedded environment
    • Working with user authentication
      • Enabling user authentication
      • Defining users
      • External directory service
        • LDAP directory service
          • Setting up Derby to use your LDAP directory service
          • Guest access to search for DNs
          • LDAP performance issues
          • LDAP restrictions
        • JNDI-specific properties for external directory services
        • User-defined class
          • Example of setting a user-defined class
      • Built-in Derby users
        • Database-level properties
        • System-level properties
      • List of user authentication properties
      • Programming applications for Derby user authentication
        • Programming the application to provide the user and password
        • Login failure exceptions with user authentication
    • Users and authorization identifiers
      • Authorization identifiers, user authentication, and user authorization
      • Database owner
      • User names and schemas
      • Exceptions when using authorization identifiers
    • User authorizations
      • Setting the default connection access mode
      • Setting access for individual users
        • Read-only and full access permissions
        • User authorization exceptions
      • Setting the SQL standard authorization mode
        • Using SQL standard authorization
        • Privileges on views, triggers, and constraints
        • Using SQL roles
        • Upgrading an old database to use SQL standard authorization
        • SQL standard authorization exceptions
    • Encrypting databases on disk
      • Requirements for Derby encryption
      • Working with encryption
        • Encrypting databases on creation
        • Encrypting an existing unencrypted database
        • Creating a boot password
          • Specifying an alternate encryption provider
          • Specifying an alternate encryption algorithm
        • Encrypting databases with a new key
          • Encrypting databases with a new boot password
          • Encrypting databases with a new external encryption key
        • Booting an encrypted database
    • Signed jar files
    • Notes on the Derby security features
    • User authentication and authorization examples
      • User authentication example in a client/server environment
        • User authentication and authorization client example
      • User authentication example in a single-user, embedded environment
        • User authentication and authorization embedded example
      • User authentication examples using SQL authorization
        • User authentication and SQL authorization client example
        • User authentication and SQL authorization embedded example
    • Running Derby under a security manager
      • Granting permissions to Derby
      • Examples of Java 2 security policy files for embedded Derby
        • Java 2 security policy file example 1
        • Java 2 security policy file example 2
        • Java 2 security policy file example 3
  • Developing tools and using Derby with an IDE
    • Offering connection choices to the user
      • The DriverPropertyInfo Array
        • DriverPropertyInfo array example
    • Using Derby with IDEs
      • IDEs and multiple JVMs
  • SQL tips
    • Retrieving the database connection URL
    • Supplying a parameter only once
    • Defining an identity column
    • Using third-party tools
    • Tricks of the VALUES clause
      • Multiple rows
      • Mapping column values to return values
      • Creating empty queries
  • Localizing Derby
    • SQL parser support for Unicode
    • Character-based collation in Derby
    • Other components with locale support
    • Messages libraries
  • Derby and standards
    • XML data types and operators
  • Trademarks