我有一个 TextField 和一个带有 mnemonicParsing 的标签。我想用 TextField 的 id 设置标签的 labelFor 属性。我如何在 FXML 中做到这一点?
<GridPane hgap="5.0" snapToPixel="false" vgap="10.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Label maxWidth="-Infinity" text="_A Label" GridPane.halignment="RIGHT" GridPane.hgrow="NEVER" GridPane.vgrow="NEVER" mnemonicParsing="true" />
<TextField id="myTextField" GridPane.columnIndex="1" GridPane.hgrow="NEVER" />
</children>
</GridPane>
Run Code Online (Sandbox Code Playgroud)
谢谢
根据这个文件:
29.1.1嵌入式数据库支持
Spring Boot可以自动配置嵌入式H2,HSQL和Derby数据库.您不需要提供任何连接URL,只需包含对要使用的嵌入式数据库的构建依赖关系.
和
29.1.2连接到生产数据库
还可以使用池化DataSource自动配置生产数据库连接.
DataSource配置由spring.datasource.*中的外部配置属性控制.例如,您可以在application.properties中声明以下部分:
spring.datasource.url=jdbc:mysql://localhost/test
spring.datasource.username=dbuser
spring.datasource.password=dbpass
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
Run Code Online (Sandbox Code Playgroud)
[Tip]您通常不需要指定driver-class-name,因为Spring引导可以从url中为大多数数据库推断出它.
[注意]对于要创建的池化DataSource,我们需要能够验证有效的Driver类是否可用,因此我们在执行任何操作之前检查它.即如果你设置 spring.datasource.driver-class-name = com.mysql.jdbc.Driver,那么该类必须是可加载的.
如果我将以下内容放在application.properties文件中,该怎么办:
spring.datasource.url=jdbc:hsqldb:file:db/organization-db
spring.datasource.username=dbuser
spring.datasource.password=dbpass
spring.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver
Run Code Online (Sandbox Code Playgroud)
Spring Boot会自动配置池数据源吗,因为我指定了spring.datasource.driver-class-name?
或者它只是为没有连接池的嵌入式数据库驱动程序创建数据源?
如何确认Spring Boot是否正在使用连接池?