Mock database driver

后端 未结 7 1428
臣服心动
臣服心动 2021-01-17 12:34

Is there some kind of JDBC driver which simply ignores database calls?

For the development I am migrating an application to a virtual machine. Here I want to work on

7条回答
  •  盖世英雄少女心
    2021-01-17 13:19

    My framework Acolyte is a tested JDBC driver designed for such purposes (mock up, testing, ...): https://github.com/cchantep/acolyte

    It already used in several open source projects, either in vanilla Java, or using its Scala DSL:

    // Register prepared handler with expected ID 'my-unique-id'
    acolyte.Driver.register("my-unique-id", handler);
    // then ...
    Connection con = DriverManager.getConnection(jdbcUrl);
    // ... Connection |con| is managed through |handler|
    

提交回复
热议问题