Hello @vpmavuri

We already discuss using of data source in thread
http://apache-ignite-users.70518.x6.nabble.com/CacheJdbcPojoStoreExampleFactory-for-Maria-DB-td7479.html

The idiomatic ways of data source usage with CacheJdbcPojoStoreFactory are
specification of data source bean name or implementation of data source
factory class. 

NOTE: When you implement data source bean factory class it should be
available in classpath for every node. F.e.: 

    public class MyDataSourceFactory implements Factory<DataSource> { 
        @Override public DataSource create() { 
            JdbcDataSource dataSource = new JdbcDataSource(); 
            dataSource.setURL("jdbc:..."); 
            dataSource.setUser("username"); 
            dataSource.setPassword("password"); 
            return dataSource; 
        } 
    } 
… 
CacheJdbcPojoStoreFactory storeFactoryJdbcPojo = new
CacheJdbcPojoStoreFactory(); 

storeFactoryJdbcPojo.setDataSourceFactory(new MyDataSourceFactory()); 
… 
NOTE: When you specify data source bean name bean with that name should be
described in spring configuration for every node. F.e: 
    
    
    <bean id="h2Jdbc" class="org.h2.jdbcx.JdbcDataSource">
        <property name="URL" value="${h2Jdbc.jdbc.url}"/>
        <property name="user" value="${h2Jdbc.jdbc.username}"/>
        <property name="password" value="${h2Jdbc.jdbc.password}"/>
    </bean>

... 
    <property name=&quot;cacheStoreFactory 
        &lt;bean
class=&quot;org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory&quot;>
            <property name="dataSourceBean" value="h2Jdbc"/>
        </bean>
    </property>
… 



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/CacheJDBCStore-creation-failing-using-MySQL-Datasource-tp7716p7759.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to