Hello,

You should set "QueryEntity" for your cache:

    <property name="cacheConfiguration">
      <list>
        <bean class="org.apache.ignite.configuration.CacheConfiguration">
          <property name="name" value="Person"/>

          <property name="queryEntities">
            <list>
              <bean class="org.apache.ignite.cache.QueryEntity">
                <property name="keyType" value="java.lang.Integer"/>
                <property name="valueType" value="java.lang.String"/>
              </bean>
            </list>
          </property>
        </bean>
      </list>
    </property>


Best Regards,
Igor

On Fri, Mar 24, 2017 at 2:00 PM, kavitha <kavithamr...@gmail.com> wrote:

> Hi,
>
> I set cache name as 'Person' in Ignite ODBC driver.
>
> <http://apache-ignite-users.70518.x6.nabble.com/file/n11420/Capture.png>
> How Can I load data in it?
> I tried following code to load data. But no tables exist, while connecting
> database through odbc connection. Please explain me how to create database
> ?
> class Program
>     {
>         static void Main(string[] args)
>         {
>             IIgnite ignite = Ignition.Start(@"F:Visual Studio
> 2015\Projects\CreateCluster\CreateCluster\my-file.xml");
>             var cache = ignite.GetOrCreateCache<int, string>("Person");
>             cache.Put(1, "John");
>             cache.Put(2, "Smith");
>             cache.Get(1);
>             cache.Get(2);
>         }
>     }
>
> my-file.xml:
> <?xml version="1.0" encoding="UTF-8"?>
>
> <beans xmlns="http://www.springframework.org/schema/beans";
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>         http://www.springframework.org/schema/beans/spring-beans.xsd";>
> <bean id="ignite.cfg"
> class="org.apache.ignite.configuration.IgniteConfiguration">
>   <property name="odbcConfiguration">
>     <bean class="org.apache.ignite.configuration.OdbcConfiguration"/>
>   </property>
>  </bean>
>  </beans>
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Load-data-to-cache-tp11394p11420.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Reply via email to