<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                數據庫地址配置 jdbc:h2:<mem|file|tcp>:<dbname>|{dbFilePath} 1.內存數據庫: jdbc:h2:mem:DbName 2. 文件數據庫 jdbc:h2:file:{FilePath} ./{path}/{fileName} 當前程序的根目錄創建目錄和數據庫文件 ~/{path}/{fileName} 當前用戶根目錄創建目錄和數據庫文件 C:/{path}/{fileName} 指定目錄 file 可以不寫 ,默認 3. 遠程數據庫 jdbc:h2:tcp://<{IP|HostName}>[:{port}]/[{Path}]<{DbName}> Spring Boot整合H2數據庫 -H2可以嵌入使用,也可以獨立使用 -H2提供了Web控制臺 -H2與Spring Boot可以完美集成 依賴導入 ????????<dependency> ????????????<groupId>com.h2database</groupId> ????????????<artifactId>h2</artifactId> ????????????<scope>runtime</scope> ????????</dependency> H2 配置 application.properties 1. 簡單配置 spring.datasource.url=jdbc:h2:mem:testdb spring.datasource.driverClassName=org.h2.Driver spring.datasource.username=sa spring.datasource.password= spring.jpa.database-platform=org.hibernate.dialect.H2Dialect 2. 數據持久化配置 # temporary data storage spring.datasource.url = jdbc:h2:file:/data/sample spring.datasource.url = jdbc:h2:file:C:/data/sample (Windows only) 3. 在初始化時創建表和插入數據。 在/src/main/resources/ 放置: schema.sql?– 創建表 data.sql? - 插入數據 4. 控制臺 spring.h2.console.enabled=true spring.h2.console.path=/h2 5. 其他配置 默認都是false 是否允許調試輸出 spring.h2.console.settings.trace=false 允許遠端訪問 spring.h2.console.settings.web-allow-others=false https://howtodoinjava.com/spring-boot2/h2-database-example/ https://docs.spring.io/spring-boot/docs/2.1.x/reference/html/howto-database-initialization.html
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看