# 3.3JDBC测试支持

org.springframework.test.jdbc包中包含JdbcTestUtils，它是与JDBC相关的实用程序函数的集合，旨在简化标准数据库测试方案。具体来说，JdbcTestUtils提供以下静态实用程序方法。

* countRowsInTable（..）：计算给定表中的行数。
* countRowsInTableWhere（..）：使用提供的WHERE子句计算给定表中的行数。
* deleteFromTables（..）：删除指定表中的所有行。
* deleteFromTableWhere（..）：使用提供的WHERE子句从给定的表中删除行。
* dropTables（..）：删除指定的表。

> AbstractTransactionalJUnit4SpringContextTests和AbstractTransactionalTestNGSpringContextTests提供了方便的方法，可以委托JdbcTestUtils中的上述方法。
>
> spring-jdbc模块支持配置和启动嵌入式数据库，你可以在与数据库交互的集成测试中使用它。有关详细信息，请参阅嵌入式数据库支持和使用嵌入式数据库测试数据访.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flydean.com/spring-framework-documentation5/testing/integration-testing/3.3jdbc-testing-support.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
