Day 8 Spring Boot Database

Day 8 Spring Boot Database

In the knowledge lies the power——Edward Albert Feigenbaum(图灵奖获得者)

The Spring Framework provides extensive support for working with SQL databases, from direct JDBC access to completeobject relational mapping” technologies.
Spring框架提供了大量的数据库相关的支持,从最直接的JDBC链接,到完整的“对象关系映射”技术。

Spring Data provides an additional level of functionality: creating Repository implementations directly from interfaces and using conventions to generate queries from your method names.
Spring Data模块还提供了一个更高级别的功能:它能通过接口文件来直接创建Repository的实现类,还可以根据惯例和方法名生成数据查询请求。

It is often convenient to develop applications by using an in-memory embedded database.
使用内存数据库便于开发应用。

Obviously, in-memory databases do not provide persistent storage.
显然,内存数据库无法提供持久数据存储。

You need to populate your database when your application starts and be prepared to throw away data when your application ends.
当应用启动时,你需要填充数据;当应用关闭时,对即将丢失的数据要有准备。

Spring Boot can auto-configure embedded databases. You need not provide any connection URLs. You need only include a build dependency to the embedded database that you want to use.
Spring Boot 可以自动配置嵌入式数据库。你甚至都不需要提供链接地址,只需要在编译依赖中加入你想使用的嵌入式数据库。

If, for whatever reason, you do configure the connection URL for an embedded database, take care to ensure that the database’s automatic shutdown is disabled.
不管出于什么原因,如果你一定要给嵌入式数据库配置链接地址,务必确保禁用数据库的自动关闭功能。

Disabling the database’s automatic shutdown lets Spring Boot control when the database is closed, thereby ensuring that it happens once access to the database is no longer needed.
数据库的自动关闭功能被禁用后,Spring Boot才能控制数据库应该何时被关闭,从而确保在应用不再需要访问数据库时,数据库可以被正确地关闭掉。

本文选自:
https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-sql.html

生词 音标 释义
extensive [ɪkˈstɛnsɪv] adj. 广阔的
direct [dɪˈrɛkt] adj. 直接的
complete [kəmˈplit] adj. 完整的
object relational mapping 对象-关系映射
additional [ə'dɪʃənl] adj. 附加的
functionality [ˌfʌŋkʃəˈnælɪti] n. 功能
repository [rɪˈpɑ:zətɔ:ri] n. 仓库
implementation [ˌɪmplɪmənˈteʃən] n. 实现
convention [kənˈvɛnʃən] n. 惯例
generate [ˈdʒɛnəˌret] n. 生成
query [ˈkwɪri] n. 查询表
method name 方法名
convenient [kənˈvinjənt] adj. 方便的
develop [dɪˈvɛləp] v. 开发
application [ˌæplɪˈkeʃən] n. 应用
embedded database 嵌入式数据库
obviously [ˈɑ:bviəsli] adj. 明显的
persistent [pərˈsɪstənt] adj. 持久的
storage [ˈstɔrɪdʒ] n. 存储
populate [ˈpɑ:pjuleɪt] v. 填充
throw away 丢弃
auto-configure 自动配置
connection [kəˈnɛkʃən] n. 连接
build dependency 编译依赖
ensure [ɛnˈʃʊr] v. 确保
automatic [ˌɔtəˈmætɪk] adj. 自动的
shutdown [ˈʃʌtˌdaʊn] n. 关闭,关机
disabled [dɪsˈebəld] adj. 残疾的;有缺陷的;禁用的
thereby [ˌðerˈbaɪ] adv. 由此,从而
access [ˈæksɛs] n. 进入
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,525评论 19 139
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 47,261评论 6 342
  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,826评论 0 10
  • 文章作者:Tyan博客:noahsnail.com | CSDN | 简书 19. Running your ap...
    SnailTyan阅读 1,870评论 0 5
  • 瑶:我看你是用心生活的人。 我:用心生活? 瑶:用心交人,随心生活,不是用头脑交人的人。 我:可能吧。 瑶:自律学...
    _食色性也_阅读 143评论 0 0

友情链接更多精彩内容