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.

/* in java */
String myURL = conn.getMetaData().getURL();
Related concepts
Supplying a parameter only once
Defining an identity column
Using third-party tools
Tricks of the VALUES clause