### Question:
AutomaticConnection implements Connection { @Override public PreparedStatement prepareStatement(String sql) throws SQLException { QueryTables tables = SqlUtil.parseTableName(sql); if (tables.isDml()) { throw new RuntimeException("Unsupported DML in JDBC model"); } List<String> names = tables.tableNames; if (names.isEmpty()) { return simpleConnection.prepareStatement(sql); } if (names.stream().anyMatch(name -> !tableNames.contains(name))) { tableNames.clear(); tableNames.addAll(names); } else { if (connection != null) { return connection.prepareStatement(sql); } } if (schemaPath.isEmpty()) { this.connection = JdbcPipeline.createSpecificConnection( MetadataPostman.getAssembledSchema(new ArrayList<>(tableNames))); } else { this.connection = JdbcPipeline.createSpecificConnection(schemaPath, new ArrayList<>(tableNames)); } return connection.prepareStatement(sql); } AutomaticConnection(String path);  AutomaticConnection(); @Override PreparedStatement prepareStatement(String sql); @Override PreparedStatement prepareStatement(String sql,
        int resultSetType,
        int resultSetConcurrency); @Override PreparedStatement prepareStatement(String sql,
        int resultSetType,
        int resultSetConcurrency,
        int resultSetHoldability); @Override PreparedStatement prepareStatement(String sql, int autoGeneratedKeys); @Override PreparedStatement prepareStatement(String sql, int[] columnIndexes); @Override PreparedStatement prepareStatement(String sql, String[] columnNames); @Override CallableStatement prepareCall(String sql); @Override CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency); @Override CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency,
        int resultSetHoldability); @Override String nativeSQL(String sql); @Override boolean getAutoCommit(); @Override void setAutoCommit(boolean autoCommit); @Override void commit(); @Override void rollback(); @Override void close(); @Override boolean isClosed(); @Override DatabaseMetaData getMetaData(); @Override boolean isReadOnly(); @Override void setReadOnly(boolean readOnly); @Override String getCatalog(); @Override void setCatalog(String catalog); @Override int getTransactionIsolation(); @Override void setTransactionIsolation(int level); @Override SQLWarning getWarnings(); @Override void clearWarnings(); @Override Statement createStatement(); @Override Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability); @Override Statement createStatement(int resultSetType, int resultSetConcurrency); @Override Map<String, Class<?>> getTypeMap(); @Override void setTypeMap(Map<String, Class<?>> map); @Override int getHoldability(); @Override void setHoldability(int holdability); @Override Savepoint setSavepoint(); @Override Savepoint setSavepoint(String name); @Override void rollback(Savepoint savepoint); @Override void releaseSavepoint(Savepoint savepoint); @Override Clob createClob(); @Override Blob createBlob(); @Override NClob createNClob(); @Override SQLXML createSQLXML(); @Override boolean isValid(int timeout); @Override void setClientInfo(String name, String value); @Override String getClientInfo(String name); @Override Properties getClientInfo(); @Override void setClientInfo(Properties properties); @Override Array createArrayOf(String typeName, Object[] elements); @Override Struct createStruct(String typeName, Object[] attributes); @Override String getSchema(); @Override void setSchema(String schema); @Override void abort(Executor executor); @Override void setNetworkTimeout(Executor executor, int milliseconds); @Override int getNetworkTimeout(); @Override T unwrap(Class<T> iface); @Override boolean isWrapperFor(Class<?> iface);  }### Answer:
@Test public void testBasicConnectFunction() { try { Connection connection = SqlRunner.getConnection(); PreparedStatement statement = connection.prepareStatement("select 1"); ResultSet resultSet = statement.executeQuery(); resultSet.next(); Assert.assertEquals(resultSet.getInt(1), 1); } catch (SQLException ex) { ex.printStackTrace(); } }