1 Reply Latest reply on May 31, 2016 11:38 AM by Scott A Johnson

    How to get database connection from Custom Plugin?

    varun.bhalla@oracle.com

      Hi,

       

      I need to connect to my Jive8 database connection and execute DML queries.

      Would you please let me know how to do it?

       

      I have extended JiveJdbcDaoSupport in my DAO implementation class and using below statement to execute the query:

       

      String sql = <my sql query>

      Map<String,Object> argMap = <arguments hash map>

       

      getNamedParameterJdbcTemplate().update(sql, argMap);

       

      In my spring.xml, I added below bean:

       

      <bean id="mybean" 

              class="com.org.project.dao.impl.DaoImplClass"> 

              <property name="dataSource"> 

                  <util:property-path path="dataSourceFactory.dataSource" /> 

              </property> 

      </bean> 

       

      This is not working and I get NullPointerException on above statement in bold.

       

      Can someone please let me know, how to do this?

       

      Thanks,

      Varun