0

I'm developing application using eclipse and equinox. I have an app and i want to transform it to modules using OSGi

My app works with module JMS (apache activemq) and module Database (Oracle).

It well with JMS.

But when I run with Oracle I get an error :

Can not connect to database, SQLException: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@192.168.0.149:1521:orcl

Before I used lib ojdbc6.jar and I transferred it to bundle (for that it can be used in OSGi with Eclipse + Equinox, I follow this tutor http://wiki.eclipse.org/Create_and_Export_MySQL_JDBC_driver_bundle)

My code :

Class.forName("oracle.jdbc.driver.OracleDriver");       

dbPool = new ConnectionPool("OracleDriver",
                                    20,
                                    40,
                                    1000,
                                    "jdbc:oracle:thin:@192.168.0.149:1521:orcl",
                                    "facebookvega",
                                    "facebook2012##",
                                    new DbConnectionExtFactoryImpl());  

DbConnectionExt getConnection() throws SQLException     
        DbConnection conn = null;
        if (timeout == 0) {
            conn = dbPool.getConnection();
        } else {
            conn = dbPool.getConnection(timeout);
        }      

Thanks for helping me !

1 Answers1

0

Have you found OSGi jar for "oracle.jdbc.driver.OracleDriver". We are trying to use same class to use JDBCTemplate in Day-CQ with Spring Framework that needs OSGi jar.

Rupesh
  • 2,627
  • 1
  • 28
  • 42