Package org.apache.derby.jdbc

Examples of org.apache.derby.jdbc.EmbeddedDriver


                _connectionManager = null;
            }

        if (_needDerbyShutdown) {
            __log.debug("shutting down derby.");
            EmbeddedDriver driver = new EmbeddedDriver();
            try {
                driver.connect(_derbyUrl + ";shutdown=true", new Properties());
            } catch (SQLException ex) {
                // Shutdown will always return an exeption!
                if (ex.getErrorCode() != 45000)
                    __log.error("Error shutting down Derby: " + ex.getErrorCode(), ex);
View Full Code Here


  }

  @Override
  public void shutdown(DataSource dataSource, String databaseName) {
    try {
      new EmbeddedDriver().connect(
          String.format(URL_TEMPLATE, databaseName, "drop=true"), new Properties());
    }
    catch (SQLException ex) {
      // Error code that indicates successful shutdown
      if (!"08006".equals(ex.getSQLState())) {
View Full Code Here

    properties.setPassword("");
  }

  public void shutdown(DataSource dataSource, String databaseName) {
    try {
      new EmbeddedDriver().connect(
          String.format(URL_TEMPLATE, databaseName, "shutdown=true"), new Properties());
    }
    catch (SQLException ex) {
      if (SHUTDOWN_CODE.equals(ex.getSQLState())) {
        purgeDatabase(databaseName);
View Full Code Here

                _connectionManager = null;
            }

        if (_needDerbyShutdown) {
            __log.debug("shutting down derby.");
            EmbeddedDriver driver = new EmbeddedDriver();
            try {
                driver.connect(_derbyUrl + ";shutdown=true", new Properties());
            } catch (SQLException ex) {
                // Shutdown will always return an exeption!
                if (ex.getErrorCode() != 45000)
                    __log.error("Error shutting down Derby: " + ex.getErrorCode(), ex);
View Full Code Here

                _connectionManager = null;
            }

        if (_needDerbyShutdown) {
            __log.debug("shutting down derby.");
            EmbeddedDriver driver = new EmbeddedDriver();
            try {
                driver.connect(_derbyUrl + ";shutdown=true", new Properties());
            } catch (SQLException ex) {
                // Shutdown will always return an exeption!
                if (ex.getErrorCode() != 45000)
                    __log.error("Error shutting down Derby: " + ex.getErrorCode(), ex);
View Full Code Here

    @After
    public void tearDown() throws Exception {
        super.tearDown();
       
        try {
            new EmbeddedDriver().connect("jdbc:derby:memory:mybatis;drop=true", new Properties());
        } catch (SQLException ex) {
            if (!"08006".equals(ex.getSQLState())) {
                throw ex;
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.derby.jdbc.EmbeddedDriver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.