記個小細節
java.sql.SQLException: Access denied for user 'as'@'localhost' (using password: YES)
之所以出現這個錯誤是因為在db.properties中寫了username=xxx
而username這個變量好像被jvm環境占用了,所以在applicationContext.xml中${username}取值得到的是jvm中username的值,
而不是db.properties中username的值,因此無法訪問數據庫
所以,在db.properties的username只要不寫成username,解決問題。