> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/iv.-spring-boot-features/29.-working-with-sql-databases/29.1.-configure-a-datasource.md).

# 29.1. 配置数据源

Java的`javax.sql.DataSource`接口提供了一个标准的使用数据库连接的方法。通常，DataSource使用`URL`和相应的凭证去初始化数据库连接。

**提示** 查看[How-to章节](https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#howto-configure-a-datasource)，获取更多的高级示例，典型地完全控制DataSource的配置。
