Derby has the following JDBC 4.1-specific DataSource classes. Use these DataSource classes if your application runs on JDK 6 or higher (except Java SE 8 Compact Profiles) and calls methods specific to JDBC 4.1 or 4.2.
Derby supports additional DataSource classes for applications that use JDK 8 Compact Profile 2 or 3. See JDBC support for Java SE 8 Compact Profiles for details.