|
SQL tips
This section provides some examples of interesting SQL features.
It also includes a few non-SQL tips.
- Retrieving the database connection URL
Derby does not have a built-in function that returns the name of the database. However, you can 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.
- Tricks of the VALUES clause
This section contains some tips to use with the VALUES clause.
|