documentation/Reference/Database Driver Reference/Derby.md
{% include database-boilerplate.html %}
| Item | Details |
|---|---|
| URL format | <code>jdbc:derby:<i>sub-protocol</i>:<i>database name</i></code> |
| Ships with Flyway Command-line | No |
| Maven Central coordinates | org.apache.derby:derbyclient |
| Supported versions | 10.11 and later |
| Default Java class | org.apache.derby.jdbc.EmbeddedDriver |
If you want to connect to a Derby database you will first need to download the driver that is compatible with Java 17 from the Derby download page Unpack and place the following files in a location Flyway can find:
derby-<verion>.jarderbyclient-<verion>.jarderbyshared-<verion>.jarderbytools-<verion>.jarThe location needs to be on the Flyway classpath, we would recommend using the jarDirs parameter, if you keep these libraries outside your Flyway installation then it will make future updates easier.
Derby support is a separate dependency for Flyway and will need to be added to your Java project to access these features.
Derby is found within the flyway-database-derby plugin module.
<dependency>
<groupId>com.redgate.flyway</groupId>
<artifactId>flyway-database-derby</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-derby</artifactId>
</dependency>
buildscript {
dependencies {
implementation "com.redgate.flyway:flyway-database-derby"
}
}
buildscript {
dependencies {
implementation "org.flywaydb:flyway-database-derby"
}
}
/* Single line comment */
CREATE TABLE test_data (
value VARCHAR(25) NOT NULL PRIMARY KEY
);
/*
Multi-line
comment
*/
-- Sql-style comment
-- Placeholder
INSERT INTO ${tableName} (name) VALUES ('Mr. T');