Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

By default it is embedded Derby 

 

Code Block
 */
public class DerbyProvider extends DatabaseProvider {
  private static final Logger LOG = Logger.getLogger(DerbyProvider.class);
  public static final String DRIVER = "org.apache.derby.jdbc.ClientDriver";
  // Used port for this instance
  int port;
  NetworkServerControl server = null;
  @Override
  public void start() {
    // Start embedded server
    try {
      port = NetworkUtils.findAvailablePort();
      LOG.info("Will bind to port " + port);
      server = new NetworkServerControl(InetAddress.getByName("localhost"), port);
      server.start(new LoggerWriter(LOG, Level.INFO));
      // Start won't thrown an exception in case that it fails to start, one
      // have to explicitly call ping() in order to verify if the server is
      // up. Check DERBY-1465 for more details.
      server.ping();
    } catch (Exception e) {
      LOG.error("Can't start Derby network server", e);
      throw new RuntimeException("Can't derby server", e);
    }
    super.start();
  }

 

...