同時(shí)連接兩個(gè)數(shù)據(jù)庫(kù),連接多個(gè)數(shù)據(jù)庫(kù)
這是我自己研究出來(lái)的,真的可以說(shuō)是世界首發(fā)了,網(wǎng)上也有一些例子,都要么就是老版本,要么就特復(fù)雜。我的這個(gè)方法特簡(jiǎn)單,希望對(duì)大家有用,也希望大家珍惜
因?yàn)楣镜男枰苯訉懙挠⑽陌娴模幌朐俜g回來(lái)了。都不難理解,一看就能明白。不懂的請(qǐng)留言
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 眼鏡蛇 閱讀(1420) 評(píng)論(6) 編輯 收藏 所屬分類: Liferay
234148464 qq求助!實(shí)在是運(yùn)行不通。。。 回復(fù) 更多評(píng)論
哪里不通 回復(fù) 更多評(píng)論
研究了一天,完全讓你的做的,不過板本是6.1,行不通,求大神賜教。。。I need your help,service builder的時(shí)候不能夠生成表,跟本連不到另一個(gè)數(shù)據(jù)源上面去。。 回復(fù) 更多評(píng)論
I am so sad! for a long time ,just bcz of this porblem....., 回復(fù) 更多評(píng)論
@彭維 如果是6.1的話,需要修改 com.liferay.portal.spring.hibernate.PortalHibernateConfiguration 為 com.liferay.portal.spring.hibernate.PortletHibernateConfiguration 回復(fù) 更多評(píng)論
跨兩個(gè)db要怎樣做transaction按照你這樣的寫法,如果拋出exception,只會(huì)有其中一個(gè)DB ROLLBACK,另一個(gè)db不會(huì)rollback,有什麼好解法嗎?jta or jotm,這兩個(gè)還要研究看看怎樣用在liferay上面 回復(fù) 更多評(píng)論
Powered by: BlogJava Copyright © 眼鏡蛇