Java知识分享网 - 轻松学习从此开始!    

Java知识分享网

Java1234官方群25:java1234官方群17
Java1234官方群25:838462530
        
SpringBoot+SpringSecurity+Vue+ElementPlus权限系统实战课程 震撼发布        

最新Java全栈就业实战课程(免费)

springcloud分布式电商秒杀实战课程

IDEA永久激活

66套java实战课程无套路领取

锋哥开始收Java学员啦!

Python学习路线图

锋哥开始收Java学员啦!
当前位置: 主页 > Java文档 > Java基础相关 >

Spring实战(第6版)英文原版 PDF 下载


分享到:
时间:2024-03-13 11:23来源:http://www.java1234.com 作者:转载  侵权举报
Spring实战(第6版)英文原版
失效链接处理
Spring实战(第6版)英文原版 PDF 下载

转载自:
http://java.python222.com/article/1054

用户下载说明:

电子版仅供预览,下载后24小时内务必删除,支持正版,喜欢的请购买正版书籍:
https://product.dangdang.com/11456511540.html
 

相关截图:




资料内容:



3.1.2 Working with JdbcTemplate
 
Before you can start using JdbcTemplate, you need to add it to your project classpath.
You can do this easily by adding Spring Boot’s JDBC starter dependency to the build
as follows:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
You’re also going to need a database where your data will be stored. For development
purposes, an embedded database will be just fine. I favor the H2 embedded database,
so I’ve added the following dependency to the build:
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
By default, the database name is randomly generated. But that makes it hard to deter
mine the database URL if, for some reason, you need to connect to the database using
the H2 console (which Spring Boot DevTools enables at http:/ /localhost:8080/h2-
console). So, it’s a good idea to pin down the database name by setting a couple of
properties in application.properties, as shown next:
spring.datasource.generate-unique-name=false
spring.datasource.name=tacocloud
Or, if you prefer, rename application.properties to application.yml and add the prop
erties in YAML format like so:
spring:
datasource:
generate-unique-name: false
name: tacocloud
The choice between properties file format and YAML format is up to you. Spring Boot
is happy to work with either. Given the structure and increased readability of YAML,
we’ll use YAML for configuration properties throughout the rest of the book.
 


------分隔线----------------------------

锋哥公众号


锋哥微信


关注公众号
【Java资料站】
回复 666
获取 
66套java
从菜鸡到大神
项目实战课程

锋哥推荐