ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kavitha <kavithamr...@gmail.com>
Subject Re: Load data to cache
Date Wed, 29 Mar 2017 02:38:35 GMT
Hi, 
I have not installed JDBC driver. Is it need to load data from store even I
enable ODBC driver in Spring XML file? I don't know whether Cache
configuration is correct or not.
 Can you Please see my Spring XML configuration file? If anything wrong in
this, Please let me know. 

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/util
        http://www.springframework.org/schema/util/spring-util.xsd">
 <bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"/>
  <bean id="ignite.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">

    
    <property name="odbcConfiguration">
      <bean class="org.apache.ignite.configuration.OdbcConfiguration"/>
    </property>
<property name="cacheConfiguration">
      <list>
        <bean class="org.apache.ignite.configuration.CacheConfiguration">
          <property name="name" value="NORTHWND"/>
           <property name="cacheMode" value="PARTITIONED"/>
            <property name="atomicityMode" value="ATOMIC"/>
            <property name="cacheStoreFactory">
                <bean
class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">
                    <property name="dataSourceBean" value="dataSource"/>
                    <property name="dialect">
                        <bean
class="org.apache.ignite.cache.store.jdbc.dialect.SQLServerDialect">
                        </bean>
                    </property>
                    <property name="types">
                        <list>
                            <bean
class="org.apache.ignite.cache.store.jdbc.JdbcType">
                                <property name="cacheName"
value="NORTHWND"/>
                                <property name="keyType"
value="java.lang.Integer"/>
                                <property name="valueType"
value="Categories"/>
                                <property name="databaseSchema"
value="Categories"/>
                                <property name="databaseTable"
value="dbo.Categories"/>
<property name="keyFields">
                                    <list>
                                        <bean
class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
                                            <constructor-arg>
                                                <util:constant
static-field="java.sql.Types.INTEGER"/>
                                            </constructor-arg>
                                            <constructor-arg
value="CategoryID"/>
                                            <constructor-arg value="int"/>
                                            <constructor-arg
value="Categoryid"/>
                                        </bean>
                                    </list>
                                </property>
                                <property name="valueFields">
                                    <list>
                                        <bean
class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
                                            <constructor-arg>
                                                <util:constant
static-field="java.sql.Types.INTEGER"/>
                                            </constructor-arg>
                                            <constructor-arg
value="CategoryID"/>
                                            <constructor-arg value="int"/>
                                            <constructor-arg
value="Categoryid"/>
                                        </bean>
					<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
                                            <constructor-arg>
                                                <util:constant
static-field="java.sql.Types.VARCHAR"/>
                                            </constructor-arg>
                                            <constructor-arg
value="CategoryName"/>
                                            <constructor-arg
value="java.lang.String"/>
                                            <constructor-arg
value="Categoryname"/></bean>
					<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
                                            <constructor-arg>
                                                <util:constant
static-field="java.sql.Types.VARCHAR"/>
                                            </constructor-arg>
                                            <constructor-arg
value="Description"/>
                                            <constructor-arg
value="java.lang.String"/>
                                            <constructor-arg
value="Description"/>
                                        </bean>
                                    </list>
                                </property>
                            </bean>
                        </list>
                    </property>
                </bean>
            </property>
            <property name="readThrough" value="true"/>
            <property name="writeThrough" value="true"/>

          <property name="queryEntities">
            <list>
              <bean class="org.apache.ignite.cache.QueryEntity">
                <property name="keyType" value="java.lang.Integer"/>
                <property name="valueType" value="Categories"/>
<property name="fields">
                            <map>
                                <entry key="CategoryID"
value="java.lang.Integer"/>
                                <entry key="CategoryName"
value="java.lang.String"/>
				<entry key="Description" value="java.lang.String"/>
                            </map>
                        </property>

              </bean>
            </list>
          </property>
        </bean>
      </list>
    </property>
            </bean>
        </beans>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Load-data-to-cache-tp11394p11527.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message