title: derby In memory database + junit
body: <p>I got an exception below when trying to use derby in memory database in JUNITTEST.</p>
  
  <blockquote>
    <p>java.sql.SQLNonTransientConnectionException: Database 'memory:testDB'
    dropped.  at
    org.apache.derby.iapi.error.StandardException.newException(Unknown
    Source)</p>
  </blockquote>
  
  <pre><code>@Before
  public void setUp() throws Exception {
      String driver = "org.apache.derby.jdbc.EmbeddedDriver";
      String connectionURL = "jdbc:derby:memory:testDB;create=true";
      Class.forName(driver);
      Connection conn = DriverManager.getConnection(connectionURL);
      super.setUp();
  }
  
  @After
  public void tearDown() throws Exception {
      String connectionURL = "jdbc:derby:memory:testDB;drop=true";
      DriverManager.getConnection(connectionURL);
  }
  </code></pre>