Connect to second database in Liferay(連接第二個數(shù)據(jù)庫)
同時連接兩個數(shù)據(jù)庫,連接多個數(shù)據(jù)庫
這是我自己研究出來的,真的可以說是世界首發(fā)了,網(wǎng)上也有一些例子,都要么就是老版本,要么就特復(fù)雜。我的這個方法特簡單,希望對大家有用,也希望大家珍惜
因為公司的需要,直接寫的英文版的,不想再翻譯回來了。都不難理解,一看就能明白。不懂的請留言
Introduction
First of all, I should say that setting liferay to connect to another database is very easy. Certainty, all of things to make easy always after numerous attempts . I searched several solutions from website before. But, not only for old version but also too complex. As my understand According to original source, and several trial. I found the way. And I think that it is the World Premiere.^_^
Prerequisites
You should know how to create services with Service Builder, Also You should know how to create new portlet. how to link to database and how it is used inside programming language code.
The steps described here were performed over Liferay 6.0.6.
Let us Beginning
1. Create a file named portal-ext.properties in {WEBSERVER-HOME}\webapps\ROOT\WEB-INF\classes. And type the following code:















2. Create a service.xml file. And type the following code:




















3. Ant build-service.xml, let liferay to generate code.
4. Create a new file named ext-spring.xml in src\META-INF folder. And copy the following code:



































5. No more. So easy right? About how to call and deploy it. I believe that you can do.
眼鏡蛇
posted on 2011-10-27 17:56 眼鏡蛇 閱讀(1428) 評論(6) 編輯 收藏 所屬分類: Liferay