Database connection URL attributes that control collation

When you create a Derby database, the attributes that you set determine the collation that is used with all character data in the database.

The following table shows some examples.

Table 1. Database creation URL attributes that control collation
Example Create URLs Collation Is Driven By
jdbc:derby:abcDB;create=true Unicode codepoint collation (UCS_BASIC), which is the default collation for Derby databases.
jdbc:derby:abcDB;create=true;territory=es_MX Unicode codepoint collation (UCS_BASIC). The collation=collation attribute is not set.
jdbc:derby:abcDB;create=true;collation=TERRITORY_BASED The locale of the JVM, since the territory=ll_CC attribute is not set.
Tip: To determine the locale of the JVM, call the Locale.getDefault method.
jdbc:derby:abcDB;create=true;territory=es_MX;collation=TERRITORY_BASED The territory=ll_CC attribute.
jdbc:derby:abcDB;create=true;territory=es_MX;collation=TERRITORY_BASED:PRIMARY The territory=ll_CC attribute with collation strength PRIMARY, which makes the database case-insensitive (it typically means that only differences in base letters are considered significant).
Related concepts
How collation works in Derby
Locale-based collation
Examples of case-sensitive and case-insensitive string sorting
Differences between LIKE and equal (=) comparisons
Related tasks
Creating a database with locale-based collation
Creating a case-insensitive database
Creating a customized collator