Search code examples
javaosgiaemosgi-bundlesling

How to use DataSourcePool in Adobe CQ5.5?


I have created a @Component and in that component at instance level I am doing @Reference DataSourcePool.

But the Class DataSourcePool is not found so my class doen't compile. I am using CRXDE Eclipse. I have done all this by following this link.

http://helpx.adobe.com/experience-manager/using/datasourcepool.html

Please See my code and snap shot.

package com.videojet.hiresite.database;

import java.sql.Connection;
import java.sql.DriverManager;
import com.day.commons.datasource.poolservice.DataSourcePool;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;

@Component
@Service
public class ConnectionProvider {

    @Reference
    private DataSourcePool source;

    public Connection getConnection() throws Exception
    {
        //VideojetDatasource
        Class.forName("oracle.jdbc.driver.OracleDriver");   
        return DriverManager.getConnection("jdbc:oracle:thin:@xxxxxx","xxxx","xxx");

    }

}

enter image description here

So Do I have to Add an Extra Jar in OSGi Bundle to this to work ?

Update @ Tomek Rękawek Dude When I say I'm not using Maven I mean it. I have NOT followed the whole tutorial. This is what I am using it's CRXDE Eclipse enter image description here


Solution

  • I solved it. I download the Jar from here http://repo.adobe.com/nexus/content/groups/public/com/day/commons/day.commons.datasource.poolservice/1.0.10/

    And I pasted it in /apps/myproject/src/testbundle/libs folder and the dependency is resolved.