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 Java Virtual Machines (JVMs)
Derby libraries and classpath/modulepath
UNIX-specific issues
Configuring file descriptors
Scripts
Upgrades
Preparing to upgrade
Upgrading a database
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 name
Special database access
Accessing databases from the classpath/modulepath
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 locale-based collation
Creating a case-insensitive database
Creating a customized collator
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/modulepath
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
Writing context-aware table functions
ArchiveVTI source code
Optimizer support for Derby-style table functions
Measuring the cost of Derby-style table functions
Example VTICosting implementation
Programming user-defined types
Programming user-defined aggregates
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
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 name and 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
How collation works in Derby
Locale-based collation
Database connection URL attributes that control collation
Examples of case-sensitive and case-insensitive string sorting
Differences between LIKE and equal (=) comparisons
Other components with locale support
Messages libraries
Derby and standards
XML data types and operators
Trademarks