spring JpetStore學習筆記 一

2021-04-13 07:58:37 字數 951 閱讀 1504

以前學習用筆記本,現在部落格這麼火,我也來湊湊熱鬧,權當做筆記本使算了,呵呵

最近學習spring,感覺自帶的寵物商店作為示範學習專案挺不錯的,新手初學,望高手門批評指正.

廢話不說了,開始吧!

1>  配置tomcat的server.xml檔案,host節點下新增上下文以及連線持,**如下:

factory

org.apache.commons.dbcp.basicdatasourcefactory

username

root

password

driverclassname

com.mysql.jdbc.driver

urljdbc:mysql://localhost:3306/jpetstore?autoreconnect=true

initialsize

20maxactive

30maxwait

10000

2>   安裝好mysql後,create database jpetstore; 然後匯入db目錄下的mysql指令碼檔案,jpetstore-mysql-schema.sql,jpetstore-mysql-dataload.sql

3>   修改工程下web-inf目錄下的jdbc.properties檔案,用#注釋掉以前內容,用作mysql資料庫,新增**:

jdbc.driverclassname=com.mysql.jdbc.driver

jdbc.url=jdbc:mysql://localhost:3306/jpetstore?autoreconnect=true

jdbc.username=root

jdbc.password=

這裡必須下在mysql的jdbc驅動放入lib包內.

至此,啟動tomcat,輸入http://localhost:8080/jpetstore,可以看到寵物商店的歡迎介面,部署成功.

spring JpetStore學習筆記

首先看看工程的web.xml檔案 petstore.root 指定log4j配置檔案位置 log4jconfiglocation web inf log4j.properties 配置檔案,local為字尾的是單資料庫,jta的為多資料庫時 contextconfiglocation 啟動時cont...

學習筆記 雜湊學習筆記

hash基本原理 hash就是乙個像函式一樣的東西,你放進去乙個值,它給你輸出來乙個值。輸出的值就是hash值。一般hash值會比原來的值更好儲存 更小 或比較。那字串hash就非常好理解了。就是把字串轉換成乙個整數的函式。而且要盡量做到使字串對應唯一的hash值。它的主要思路是選取恰當的進製,可以...

學習筆記 CentOS 學習筆記01

簡單的做個課堂筆記 虛擬機器用的是vmware,系統是centos cd etc sysconfig network scripts pwdls 顯示列表 cat ifcfg eth0 檢視檔案內容 vi ifcfg eth0 進入vi編輯器 onboot no 原始設定 x逐字刪除 d刪除整行 a...