第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用 mariaDB 在 Spring-Boot 中實現(xiàn)多個數(shù)據(jù)庫

使用 mariaDB 在 Spring-Boot 中實現(xiàn)多個數(shù)據(jù)庫

www說 2021-09-12 19:58:04
我需要知道從多個數(shù)據(jù)庫訪問存儲庫和實體類的簡單步驟。例如:我有用戶表DB1和電子郵件在DB2必須從單一的服務(wù)請求訪問。數(shù)據(jù)庫 1spring.datasource.url = jdbc:mysql://localhost:3306/dbName1?useSSL=falsespring.datasource.username = userspring.datasource.password = passwordspring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialectspring.jpa.hibernate.ddl-auto = update數(shù)據(jù)庫 2spring.datasource.url = jdbc:mysql://localhost:3306/dbName2?useSSL=falsespring.datasource.username = userspring.datasource.password = passwordspring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect其他屬性spring.jpa.properties.hibernate.jdbc.batch_size=20spring.jpa.properties.hibernate.order_inserts=truespring.jpa.properties.hibernate.order_updates=truespring.jpa.properties.hibernate.jdbc.batch_versioned_data=truespring.servlet.multipart.max-file-size=100MB spring.servlet.multipart.max-request-size=100MB
查看完整描述

3 回答

?
牛魔王的故事

TA貢獻1830條經(jīng)驗 獲得超3個贊

(不是直接回答。)


如果您將使用普通英語以外的文本,請考慮以下設(shè)置:


休眠 XML:


<property name="hibernate.connection.CharSet">utf8mb4</property>

<property name="hibernate.connection.characterEncoding">UTF-8</property>

<property name="hibernate.connection.useUnicode">true</property>

連接網(wǎng)址:


db.url=jdbc:mysql://localhost:3306/db_name?useUnicode=true&character_set_server=utf8mb4


查看完整回答
反對 回復(fù) 2021-09-12
?
米脂

TA貢獻1836條經(jīng)驗 獲得超3個贊

@Table(name="tablename", catalog="db2")

為我工作


查看完整回答
反對 回復(fù) 2021-09-12
  • 3 回答
  • 0 關(guān)注
  • 323 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號