This section provides some examples of interesting SQL features.
It also includes a few non-SQL tips.
Retrieving the database name and connection URL
To retrieve the database name, invoke the SYSCS_UTIL.SYSCS_GET_DATABASE_NAME() system function, as documented in the Derby Reference Manual. You can also use DatabaseMetaData to return the connection URL of any local Connection.
Supplying a parameter only once
If you want to supply a parameter value once and use it multiple times within a query, put it in the FROM clause with an appropriate CAST.
Defining an identity column
An identity column is a column that stores numbers that increment by one with each insertion. Identity columns are sometimes called autoincrement columns.
Using third-party tools
You can hook into any JDBC tool with just our JDBC Driver class name (org.apache.derby.jdbc.EmbeddedDriver) and Derby's JDBC connection URL.