背景 工作中要實現跨數據庫的package調用,在jsp前端返回,目前項目上只是Maven,所以參照Andyの筆記來看看結合自己所在項目都需要哪些更新來實現一個簡單的功能。 1、Maven 雖然項目中已經在Eclipse中嵌入了Maven,但還是可以單獨安裝一個Maven的工具在系統
工作中要實現跨數據庫的package調用,在jsp前端返回,目前項目上只是Maven,所以參照Andyの筆記來看看結合自己所在項目都需要哪些更新來實現一個簡單的功能。
雖然項目中已經在Eclipse中嵌入了Maven,但還是可以單獨安裝一個Maven的工具在系統中,參考Andy的Maven環境搭建和介紹 來操作即可。
中間遇到了問題“-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.”,可以在這里解決。
加載完dependence之后,按Andy的Mybatis使用generator自動生成映射配置文件信息交待生成配置文件。其中正確生成了BxxxxxLxxxx.java,BxxxxxLxxxxMapper.java 以及BxxxxxLxxxxMapper.xml,分別放在\src\main\java\com\xxxxx\xxx\domain,src\main\java\com\xxxxx\xxx\mapper以及src\main\java\com\xxxxx\xxx\mapper\sqlmaps目錄下。
按照步驟提示繼續,針對即將新引入的jar包,更改pom.xml文件
org.springframework spring-core3.1.1.RELEASE org.springframework spring-beans3.1.1.RELEASE org.springframework spring-context3.1.1.RELEASE org.springframework spring-tx3.1.1.RELEASE org.springframework spring-web3.1.1.RELEASE org.springframework spring-webmvc3.1.1.RELEASE org.springframework spring-jdbc3.1.1.RELEASE org.springframework spring-test3.1.1.RELEASE test org.mybatis mybatis3.1.0 org.mybatis mybatis-spring1.1.1 log4j log4j1.2.17 org.apache.struts struts2-core2.3.16.3 org.apache.struts struts2-json-plugin2.3.16.3 org.apache.struts struts2-spring-plugin2.3.16.3 com.google.code.gson gson2.1 com.mchange c3p00.9.5 org.aspectj aspectjweaver1.6.8 ... cglib cglib2.2.2 src/main/resource *.xml *.properties
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com