Bob Ward 7 Years Ago Thanks for this post it is very clear how you achieve it. I know we have discussed this type of approach before but right now we are currently:1. point to ROOT.xml file via this add to our portal-ext.propertiesjdbc.default.jndi.name=jdbc/LiferayPool2. in the ROOT.xml file we define the jndi like this:<!--<Manager className="com.liferay.support.tomcat.session.SessionLessManagerBase" />--> <Resource name="jdbc/LiferayPool" auth="Container" type="javax.sql.DataSource" driverClassName="net.sourceforge.jtds.jdbc.Driver" url="jdbc:jtds:sqlserver://cont90:1433/LR_CONT165_PROD_GA2_A" username="liferaysqladmin" password="L!fer@y5ql" maxActive="500" maxIdle="120" maxWait="20000" removeAbandoned="true" removeAbandonedTimeout="20" logAbandoned="true" maxPoolSize="100" minPoolSize="10" acquireIncrement="10" validationQuery="SELECT 1" minEvictableIdleTimeMillis="3600000" timeBetweenEvictionRunsMillis="1800000" numTestsPerEvictionRun="10" testWhileIdle="true" testOnBorrow="true" testOnReturn="false" />Could you comment on the advantage with your approach?Thanks. Please sign in to reply. Reply as... Cancel Devang Patel Bob Ward 7 Years Ago - Edited JNDI is fatser than JDBC configuration. And main advantage while moving or deploying code to other developement.JNDI really useful when you have to move an application between environments: development to integration to test to production. If you configure each app server to use the same JNDI name, you can have different databases in each environment and not have to change your code. You just pick up the WAR file and drop it in the new environment. Please sign in to reply. Reply as... Cancel
Devang Patel Bob Ward 7 Years Ago - Edited JNDI is fatser than JDBC configuration. And main advantage while moving or deploying code to other developement.JNDI really useful when you have to move an application between environments: development to integration to test to production. If you configure each app server to use the same JNDI name, you can have different databases in each environment and not have to change your code. You just pick up the WAR file and drop it in the new environment. Please sign in to reply. Reply as... Cancel
Clint Wilde 7 Years Ago Hi Devang,I am using a standard OSGi module, without Spring. How do I do that last step without spring?Thank you,Clint Please sign in to reply. Reply as... Cancel Devang Patel Clint Wilde 7 Years Ago As I know if you are using service builder than you have to do with spring for LR 6.2 for external database configuration.but no one can stop you to do with JDBC if you are not using service builder. Please sign in to reply. Reply as... Cancel
Devang Patel Clint Wilde 7 Years Ago As I know if you are using service builder than you have to do with spring for LR 6.2 for external database configuration.but no one can stop you to do with JDBC if you are not using service builder. Please sign in to reply. Reply as... Cancel
Kanwar Yuvraj Singh 7 Years Ago Thank you for providing this. Where should i do the third step if all i have is a liferay MVC portlet?Using Liferay 7.0 GA2 Please sign in to reply. Reply as... Cancel Eoin Hartnett Kanwar Yuvraj Singh 7 Years Ago Hi Kanwar,If you are connecting to an external database, your portlet should have an ext-spring.xml file in the META_INF folder. You should perform step 3 on this file. Please sign in to reply. Reply as... Cancel Kanwar Yuvraj Singh Eoin Hartnett 7 Years Ago Thanks for your reply. Can this step be done at portal level instead of a portlet and make it available in all portlets. I also want to use this JNDI in a lpkg portlet downloaded from liferay marketplace Please sign in to reply. Reply as... Cancel Eoin Hartnett Kanwar Yuvraj Singh 7 Years Ago No, this step needs to be done at the portlet level. Please sign in to reply. Reply as... Cancel
Eoin Hartnett Kanwar Yuvraj Singh 7 Years Ago Hi Kanwar,If you are connecting to an external database, your portlet should have an ext-spring.xml file in the META_INF folder. You should perform step 3 on this file. Please sign in to reply. Reply as... Cancel Kanwar Yuvraj Singh Eoin Hartnett 7 Years Ago Thanks for your reply. Can this step be done at portal level instead of a portlet and make it available in all portlets. I also want to use this JNDI in a lpkg portlet downloaded from liferay marketplace Please sign in to reply. Reply as... Cancel Eoin Hartnett Kanwar Yuvraj Singh 7 Years Ago No, this step needs to be done at the portlet level. Please sign in to reply. Reply as... Cancel
Kanwar Yuvraj Singh Eoin Hartnett 7 Years Ago Thanks for your reply. Can this step be done at portal level instead of a portlet and make it available in all portlets. I also want to use this JNDI in a lpkg portlet downloaded from liferay marketplace Please sign in to reply. Reply as... Cancel Eoin Hartnett Kanwar Yuvraj Singh 7 Years Ago No, this step needs to be done at the portlet level. Please sign in to reply. Reply as... Cancel
Eoin Hartnett Kanwar Yuvraj Singh 7 Years Ago No, this step needs to be done at the portlet level. Please sign in to reply. Reply as... Cancel
Thomas Kellerer 6 Years Ago How can such a JNDI datasource be used with Liferay 7 in a Portlet that does NOT use Spring? The standard JavaEE lookup through the IntialContext does not work any longer with Liferay 7 Please sign in to reply. Reply as... Cancel