Compatibility

JDBC drivers

JDBDT is expected to work with any (sane) JDBC driver. The JDBDT build currently tests integration with:

Known issues

PostgreSQL

Auto-commit off / Rollback on error

If auto-commit is turned off for the database connection and a SQL statement raises an error (e.g., an integrity constraint is violated during an insertion), PostgreSQL aborts the transaction and requires an explicit rollback execute further statements. This is a well known issue in PostgreSQL (e.g., see here). When using JDBDT, this may affect tests that validate invalid uses of a database by the SUT:

    try {
      // at this point connection has autocommit turned off
      call SUT, expecting it to throw a database exception, e.g., 
                insert data that violates a primary key   
      fail("exception expected");
    }
    catch(SQLException e) { 
      assertXXX(...);        // e.g. assertUnchanged(...)
    }

The assertXXX JDBDT assertion above (or any other code that issues a database statement for that matter) will fail with the following message

org.postgresql.util.PSQLException: 
   ERROR: current transaction is aborted, commands ignored until 
          end of transaction block 

A possible workaround is to issue a rollback statement before any further operations, i.e., before assertXXX in the example snippet above.

 

sqlite

Statement reuse

Statement reuse should be disabled for xerial’s JDBC driver for sqlite.

Table truncation is not supported

sqlite does not support TRUNCATE statements, so JDBDT.truncate will not work.