鍩轰簬SpringBoot鎼缓涓€涓甫鏁版嵁搴撹闂殑WEB椤圭洰(璁板綍鎵€闇€鐨勪緷璧?閰嶇疆,椹卞姩瀹夎绛夋敞鎰忎簨椤?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了鍩轰簬SpringBoot鎼缓涓€涓甫鏁版嵁搴撹闂殑WEB椤圭洰(璁板綍鎵€闇€鐨勪緷璧?閰嶇疆,椹卞姩瀹夎绛夋敞鎰忎簨椤?相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/%e9%a1%b9%e7%9b%ae' title='椤圭洰'>椤圭洰   鎺㈢储   rac   浠g悊   ora   ORC   web椤圭洰   service   password   

绗竴姝? 鎸夋甯哥殑鍒涘缓MAVEN椤圭洰鐨勬楠ゅ垱寤轰竴涓猰aven椤圭洰

绗簩姝? 鎸夋甯哥殑SpringBoot娉ㄨВ鏂瑰紡,娣诲姞鎺у埗鍣?鍚姩绫?骞跺垱寤烘搷浣滄暟鎹簱鐨凞ao鎺ュ彛鍜孌ao.xml

浠ヤ笅鏄敞鎰忕偣:

1.渚濊禆:

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.0.1</version>
</dependency>
</dependencies>
2.鏁版嵁搴撹繛鎺ラ厤缃?
spring.datasource.url=jdbc:oracle:thin:@localhost:1521:orcl
spring.datasource.username=scott
spring.datasource.password=Pr0d1234!
spring.datasource.driverClassName=oracle.jdbc.driver.OracleDriver
3.娉ㄨВ娉ㄦ剰:
浣跨敤@MapperScan娉ㄨВ,鍙互灏哾ao鏂囦欢澶逛笅鐨勬墍鏈夋帴鍙f壂鎻忚繘瀹瑰櫒,骞跺湪鍚姩鏃跺氨鐢熸垚杩欎簺鎺ュ彛鐨勪唬鐞嗗疄渚?br />濡傛灉涓嶄娇鐢?灏嗘棤娉曚娇鐢ˊAutowired灏哾ao鎺ュ彛瀹炰緥娉ㄥ叆鍒皊ervice绫?br />浣跨敤浠ュ悗,dao鎺ュ彛鏃犻渶鏍囨敞浠讳綍娉ㄨВ

鎶€鏈浘鐗? src=

 

 4.椹卞姩:

灏哋racle椹卞姩娣诲姞鍒颁緷璧栭」涓?鍚﹀垯鎶ユ壘涓嶅埌椹卞姩
鎶€鏈浘鐗? src=

 

 浠ヤ笂璁板綍涓昏鏄负浜?浠ュ悗闇€瑕佹帰绱㈡煇鎶€鏈椂,鑳藉揩閫熸惌寤轰竴涓甫鏁版嵁搴撹闂殑web椤圭洰,閬垮厤姣忔閮藉埌澶勬壘椹卞姩,璋冮厤缃?璋冨惎鍔ㄨ€岃€借鏃堕棿.



以上是关于鍩轰簬SpringBoot鎼缓涓€涓甫鏁版嵁搴撹闂殑WEB椤圭洰(璁板綍鎵€闇€鐨勪緷璧?閰嶇疆,椹卞姩瀹夎绛夋敞鎰忎簨椤?的主要内容,如果未能解决你的问题,请参考以下文章

涓€鏉℃洿鏂癝QL鍦∕ySQL鏁版嵁搴撲腑鏄浣曟墽琛岀殑

drogon鍏ラ棬鏁欑▼涓?鎺у埗鍣ㄥ拰鏁版嵁搴撳鎴风浣跨敤

鏁版嵁搴撻┍鍔ㄨ繛鎺ュ瓧绗︿覆

鏁版嵁搴撶瑪璁?馃搾 MySQL鍩虹鎿嶄綔鍛戒护 鍒嗙被娓呮櫚

闈㈣瘯瀹橈細鏁版嵁搴撹繛鎺ユ睜涓轰粈涔堥兘瑕佺敤Threadlocal鍛紵