You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by narges saleh <sn...@gmail.com> on 2020/01/15 12:59:07 UTC

JDBC Connectivity

Hi All,

I am trying to use ignite's cache grid with native persistence and prefer
to use JDBC for cache/db connectivity.

1) Is this possible, in either client or server mode?
2) If yes, I assume, I'd need one JDBC connection per cache, as I see it is
possible to specify only one cache per JDBC connection. Is this right?
3) Is this also true if I need to join multiple tables/caches?
4) Can I specify my caches in XML config file and just pass the config file
to the JDBC connection?
5) Will I get the same load performance if I JDBC with streaming set to
true as I'd using the streamer module directly (I see that I can specify
most of the streamer config options on JDBC connection configuration)?

thanks.

Re: JDBC Connectivity

Posted by Stephen Darlington <st...@gridgain.com>.
> 1) Is this possible, in either client or server mode?

Yes.

> 2) If yes, I assume, I'd need one JDBC connection per cache, as I see it is possible to specify only one cache per JDBC connection. Is this right?

No. You can access any cache that has SQL enabled as long as you fully qualify it.

> 3) Is this also true if I need to join multiple tables/caches?

See above.

> 4) Can I specify my caches in XML config file and just pass the config file to the JDBC connection?

If you use the thin JDBC driver, you just need a host name and port. For a thick client you wouldn’t need to specify the caches in the XML file (though if they’re in there it won’t be a problem).

> 5) Will I get the same load performance if I JDBC with streaming set to true as I'd using the streamer module directly (I see that I can specify most of the streamer config options on JDBC connection configuration)?

You mean the IgniteDataStreamer? If so, no. At the very least, it has to parse the SQL which the data streamer doesn’t have to do.

Regards,
Stephen


Re: JDBC Connectivity

Posted by Stephen Darlington <st...@gridgain.com>.
It’ll get the cache definitions from the cluster. I don’t think the types in the XML file will have any effect here.

> On 20 Jan 2020, at 18:52, narges saleh <sn...@gmail.com> wrote:
> 
> Hello Stephan,
> 
> I mean using JDBC defined types in the XML file, to define the tables. Similar to the way  JDBC types are used in defining tables with 3rd party databases.
> 
> thanks.
> 
> On Mon, Jan 20, 2020 at 10:04 AM Stephen Darlington <stephen.darlington@gridgain.com <ma...@gridgain.com>> wrote:
> Which JDBC settings? If you use the JDBC thick client, you can define your caches there if you like.
> 
>> On 18 Jan 2020, at 12:01, narges saleh <snarges124@gmail.com <ma...@gmail.com>> wrote:
>> 
>> Hello Stephan,
>> 
>> Thanks. I get this working using query entity in my XML config file. I assume it is not possible to do the same with JDBC settings in the XML file.
>> 
>> On Fri, Jan 17, 2020 at 2:10 AM Stephen Darlington <stephen.darlington@gridgain.com <ma...@gridgain.com>> wrote:
>> See the “Configuring Indexes using query entities” section of the documentation:  https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes#configuring-indexes-using-query-entities <https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes#configuring-indexes-using-query-entities>
>> 
>> Regards,
>> Stephen 
>> 
>>> On 16 Jan 2020, at 23:14, narges saleh <snarges124@gmail.com <ma...@gmail.com>> wrote:
>>> 
>>> 
>>> Thanks Stephan.
>>> 
>>> Can you send me an example where the cache and tables are entirely defined in the XML configuration file (and no POJO), with query entity or just JDBC? Let's assume that the sql codes run on a server node or a thick client.
>>> 
>>> 
>>> On Thu, Jan 16, 2020 at 8:02 AM Stephen Darlington <stephen.darlington@gridgain.com <ma...@gridgain.com>> wrote:
>>> If you create a cache, either in code or XML, using the minimal list of parameter it won’t be accessible using SQL.
>>> 
>>> There are a number of ways you can define what’s visible using SQL. You can use a POJO with the @QuerySqlField annotation (and the indexTypes property in the XML file) or define QueryEntities. See the documentarian: https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes <https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes> 
>>> 
>>> Whether you do it on the client or server side is a bit of a religious debate, but either works. The important thing is that the first definition to hit the cluster is the one that takes effect. 
>>> 
>>> The most common pattern I see with JDBC is the caches are defined server side, and clients connect using the thin-client driver. Thin clients just need a hostname and port.
>>> 
>>> However, there is also a thick-client JDBC driver. The XML here is no different from any other node.
>>> 
>>> Regards,
>>> Stephen
>>> 
>>>> On 16 Jan 2020, at 12:54, narges saleh <snarges124@gmail.com <ma...@gmail.com>> wrote:
>>>> 
>>>> Thanks Ilya, Steve.
>>>> 1) What do you mean by SQL enabled? Do I still need to define the POJO classes for the objects/tables?
>>>> 2) Can I specify the caches including the table definitions entirely in XML config file and pass the config file to the JDBC connection? If yes, I'd greatly appreciate it if you provide some small samples. Please keep in mind that we have native persistence in place not a third party database.
>>>> 
>>>> 
>>>> 
>>>> On Wed, Jan 15, 2020 at 7:29 AM Ilya Kasnacheev <ilya.kasnacheev@gmail.com <ma...@gmail.com>> wrote:
>>>> Hello!
>>>> 
>>>> 4) I actually think that if you specify caches in thick client's config file, and they are absent on server, they will be created.
>>>> 
>>>> (However, they will not be changed if configuration differs)
>>>> 
>>>> Regards,
>>>> -- 
>>>> Ilya Kasnacheev
>>>> 
>>>> 
>>>> ср, 15 янв. 2020 г. в 15:59, narges saleh <snarges124@gmail.com <ma...@gmail.com>>:
>>>> Hi All,
>>>> 
>>>> I am trying to use ignite's cache grid with native persistence and prefer to use JDBC for cache/db connectivity.
>>>> 
>>>> 1) Is this possible, in either client or server mode?
>>>> 2) If yes, I assume, I'd need one JDBC connection per cache, as I see it is possible to specify only one cache per JDBC connection. Is this right?
>>>> 3) Is this also true if I need to join multiple tables/caches?
>>>> 4) Can I specify my caches in XML config file and just pass the config file to the JDBC connection?
>>>> 5) Will I get the same load performance if I JDBC with streaming set to true as I'd using the streamer module directly (I see that I can specify most of the streamer config options on JDBC connection configuration)?
>>>> 
>>>> thanks.
>>> 
>>> 
> 
> 



Re: JDBC Connectivity

Posted by narges saleh <sn...@gmail.com>.
Hello Stephan,

I mean using JDBC defined types in the XML file, to define the tables.
Similar to the way  JDBC types are used in defining tables with 3rd party
databases.

thanks.

On Mon, Jan 20, 2020 at 10:04 AM Stephen Darlington <
stephen.darlington@gridgain.com> wrote:

> Which JDBC settings? If you use the JDBC thick client, you can define your
> caches there if you like.
>
> On 18 Jan 2020, at 12:01, narges saleh <sn...@gmail.com> wrote:
>
> Hello Stephan,
>
> Thanks. I get this working using query entity in my XML config file. I
> assume it is not possible to do the same with JDBC settings in the XML file.
>
> On Fri, Jan 17, 2020 at 2:10 AM Stephen Darlington <
> stephen.darlington@gridgain.com> wrote:
>
>> See the “Configuring Indexes using query entities” section of the
>> documentation:
>> https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes#configuring-indexes-using-query-entities
>>
>> Regards,
>> Stephen
>>
>> On 16 Jan 2020, at 23:14, narges saleh <sn...@gmail.com> wrote:
>>
>> 
>> Thanks Stephan.
>>
>> Can you send me an example where the cache and tables are entirely
>> defined in the XML configuration file (and no POJO), with query entity or
>> just JDBC? Let's assume that the sql codes run on a server node or a thick
>> client.
>>
>>
>> On Thu, Jan 16, 2020 at 8:02 AM Stephen Darlington <
>> stephen.darlington@gridgain.com> wrote:
>>
>>> If you create a cache, either in code or XML, using the minimal list of
>>> parameter it won’t be accessible using SQL.
>>>
>>> There are a number of ways you can define what’s visible using SQL. You
>>> can use a POJO with the @QuerySqlField annotation (and the indexTypes
>>> property in the XML file) or define QueryEntities. See the documentarian:
>>> https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes
>>>
>>> Whether you do it on the client or server side is a bit of a religious
>>> debate, but either works. The important thing is that the first definition
>>> to hit the cluster is the one that takes effect.
>>>
>>> The most common pattern I see with JDBC is the caches are defined server
>>> side, and clients connect using the *thin-client* driver. Thin clients
>>> just need a hostname and port.
>>>
>>> However, there is also a thick-client JDBC driver. The XML here is no
>>> different from any other node.
>>>
>>> Regards,
>>> Stephen
>>>
>>> On 16 Jan 2020, at 12:54, narges saleh <sn...@gmail.com> wrote:
>>>
>>> Thanks Ilya, Steve.
>>> 1) What do you mean by SQL enabled? Do I still need to define the POJO
>>> classes for the objects/tables?
>>> 2) Can I specify the caches including the table definitions entirely in
>>> XML config file and pass the config file to the JDBC connection? If yes,
>>> I'd greatly appreciate it if you provide some small samples. Please keep in
>>> mind that we have native persistence in place not a third party database.
>>>
>>>
>>>
>>> On Wed, Jan 15, 2020 at 7:29 AM Ilya Kasnacheev <
>>> ilya.kasnacheev@gmail.com> wrote:
>>>
>>>> Hello!
>>>>
>>>> 4) I actually think that if you specify caches in thick client's config
>>>> file, and they are absent on server, they will be created.
>>>>
>>>> (However, they will not be changed if configuration differs)
>>>>
>>>> Regards,
>>>> --
>>>> Ilya Kasnacheev
>>>>
>>>>
>>>> ср, 15 янв. 2020 г. в 15:59, narges saleh <sn...@gmail.com>:
>>>>
>>>>> Hi All,
>>>>>
>>>>> I am trying to use ignite's cache grid with native persistence and
>>>>> prefer to use JDBC for cache/db connectivity.
>>>>>
>>>>> 1) Is this possible, in either client or server mode?
>>>>> 2) If yes, I assume, I'd need one JDBC connection per cache, as I see
>>>>> it is possible to specify only one cache per JDBC connection. Is this right?
>>>>> 3) Is this also true if I need to join multiple tables/caches?
>>>>> 4) Can I specify my caches in XML config file and just pass the config
>>>>> file to the JDBC connection?
>>>>> 5) Will I get the same load performance if I JDBC with streaming set
>>>>> to true as I'd using the streamer module directly (I see that I can specify
>>>>> most of the streamer config options on JDBC connection configuration)?
>>>>>
>>>>> thanks.
>>>>>
>>>>
>>>
>>>
>
>

Re: JDBC Connectivity

Posted by Stephen Darlington <st...@gridgain.com>.
Which JDBC settings? If you use the JDBC thick client, you can define your caches there if you like.

> On 18 Jan 2020, at 12:01, narges saleh <sn...@gmail.com> wrote:
> 
> Hello Stephan,
> 
> Thanks. I get this working using query entity in my XML config file. I assume it is not possible to do the same with JDBC settings in the XML file.
> 
> On Fri, Jan 17, 2020 at 2:10 AM Stephen Darlington <stephen.darlington@gridgain.com <ma...@gridgain.com>> wrote:
> See the “Configuring Indexes using query entities” section of the documentation:  https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes#configuring-indexes-using-query-entities <https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes#configuring-indexes-using-query-entities>
> 
> Regards,
> Stephen 
> 
>> On 16 Jan 2020, at 23:14, narges saleh <snarges124@gmail.com <ma...@gmail.com>> wrote:
>> 
>> 
>> Thanks Stephan.
>> 
>> Can you send me an example where the cache and tables are entirely defined in the XML configuration file (and no POJO), with query entity or just JDBC? Let's assume that the sql codes run on a server node or a thick client.
>> 
>> 
>> On Thu, Jan 16, 2020 at 8:02 AM Stephen Darlington <stephen.darlington@gridgain.com <ma...@gridgain.com>> wrote:
>> If you create a cache, either in code or XML, using the minimal list of parameter it won’t be accessible using SQL.
>> 
>> There are a number of ways you can define what’s visible using SQL. You can use a POJO with the @QuerySqlField annotation (and the indexTypes property in the XML file) or define QueryEntities. See the documentarian: https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes <https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes> 
>> 
>> Whether you do it on the client or server side is a bit of a religious debate, but either works. The important thing is that the first definition to hit the cluster is the one that takes effect. 
>> 
>> The most common pattern I see with JDBC is the caches are defined server side, and clients connect using the thin-client driver. Thin clients just need a hostname and port.
>> 
>> However, there is also a thick-client JDBC driver. The XML here is no different from any other node.
>> 
>> Regards,
>> Stephen
>> 
>>> On 16 Jan 2020, at 12:54, narges saleh <snarges124@gmail.com <ma...@gmail.com>> wrote:
>>> 
>>> Thanks Ilya, Steve.
>>> 1) What do you mean by SQL enabled? Do I still need to define the POJO classes for the objects/tables?
>>> 2) Can I specify the caches including the table definitions entirely in XML config file and pass the config file to the JDBC connection? If yes, I'd greatly appreciate it if you provide some small samples. Please keep in mind that we have native persistence in place not a third party database.
>>> 
>>> 
>>> 
>>> On Wed, Jan 15, 2020 at 7:29 AM Ilya Kasnacheev <ilya.kasnacheev@gmail.com <ma...@gmail.com>> wrote:
>>> Hello!
>>> 
>>> 4) I actually think that if you specify caches in thick client's config file, and they are absent on server, they will be created.
>>> 
>>> (However, they will not be changed if configuration differs)
>>> 
>>> Regards,
>>> -- 
>>> Ilya Kasnacheev
>>> 
>>> 
>>> ср, 15 янв. 2020 г. в 15:59, narges saleh <snarges124@gmail.com <ma...@gmail.com>>:
>>> Hi All,
>>> 
>>> I am trying to use ignite's cache grid with native persistence and prefer to use JDBC for cache/db connectivity.
>>> 
>>> 1) Is this possible, in either client or server mode?
>>> 2) If yes, I assume, I'd need one JDBC connection per cache, as I see it is possible to specify only one cache per JDBC connection. Is this right?
>>> 3) Is this also true if I need to join multiple tables/caches?
>>> 4) Can I specify my caches in XML config file and just pass the config file to the JDBC connection?
>>> 5) Will I get the same load performance if I JDBC with streaming set to true as I'd using the streamer module directly (I see that I can specify most of the streamer config options on JDBC connection configuration)?
>>> 
>>> thanks.
>> 
>> 



Re: JDBC Connectivity

Posted by narges saleh <sn...@gmail.com>.
Hello Stephan,

Thanks. I get this working using query entity in my XML config file. I
assume it is not possible to do the same with JDBC settings in the XML file.

On Fri, Jan 17, 2020 at 2:10 AM Stephen Darlington <
stephen.darlington@gridgain.com> wrote:

> See the “Configuring Indexes using query entities” section of the
> documentation:
> https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes#configuring-indexes-using-query-entities
>
> Regards,
> Stephen
>
> On 16 Jan 2020, at 23:14, narges saleh <sn...@gmail.com> wrote:
>
> 
> Thanks Stephan.
>
> Can you send me an example where the cache and tables are entirely defined
> in the XML configuration file (and no POJO), with query entity or just
> JDBC? Let's assume that the sql codes run on a server node or a thick
> client.
>
>
> On Thu, Jan 16, 2020 at 8:02 AM Stephen Darlington <
> stephen.darlington@gridgain.com> wrote:
>
>> If you create a cache, either in code or XML, using the minimal list of
>> parameter it won’t be accessible using SQL.
>>
>> There are a number of ways you can define what’s visible using SQL. You
>> can use a POJO with the @QuerySqlField annotation (and the indexTypes
>> property in the XML file) or define QueryEntities. See the documentarian:
>> https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes
>>
>> Whether you do it on the client or server side is a bit of a religious
>> debate, but either works. The important thing is that the first definition
>> to hit the cluster is the one that takes effect.
>>
>> The most common pattern I see with JDBC is the caches are defined server
>> side, and clients connect using the *thin-client* driver. Thin clients
>> just need a hostname and port.
>>
>> However, there is also a thick-client JDBC driver. The XML here is no
>> different from any other node.
>>
>> Regards,
>> Stephen
>>
>> On 16 Jan 2020, at 12:54, narges saleh <sn...@gmail.com> wrote:
>>
>> Thanks Ilya, Steve.
>> 1) What do you mean by SQL enabled? Do I still need to define the POJO
>> classes for the objects/tables?
>> 2) Can I specify the caches including the table definitions entirely in
>> XML config file and pass the config file to the JDBC connection? If yes,
>> I'd greatly appreciate it if you provide some small samples. Please keep in
>> mind that we have native persistence in place not a third party database.
>>
>>
>>
>> On Wed, Jan 15, 2020 at 7:29 AM Ilya Kasnacheev <
>> ilya.kasnacheev@gmail.com> wrote:
>>
>>> Hello!
>>>
>>> 4) I actually think that if you specify caches in thick client's config
>>> file, and they are absent on server, they will be created.
>>>
>>> (However, they will not be changed if configuration differs)
>>>
>>> Regards,
>>> --
>>> Ilya Kasnacheev
>>>
>>>
>>> ср, 15 янв. 2020 г. в 15:59, narges saleh <sn...@gmail.com>:
>>>
>>>> Hi All,
>>>>
>>>> I am trying to use ignite's cache grid with native persistence and
>>>> prefer to use JDBC for cache/db connectivity.
>>>>
>>>> 1) Is this possible, in either client or server mode?
>>>> 2) If yes, I assume, I'd need one JDBC connection per cache, as I see
>>>> it is possible to specify only one cache per JDBC connection. Is this right?
>>>> 3) Is this also true if I need to join multiple tables/caches?
>>>> 4) Can I specify my caches in XML config file and just pass the config
>>>> file to the JDBC connection?
>>>> 5) Will I get the same load performance if I JDBC with streaming set to
>>>> true as I'd using the streamer module directly (I see that I can specify
>>>> most of the streamer config options on JDBC connection configuration)?
>>>>
>>>> thanks.
>>>>
>>>
>>
>>

Re: JDBC Connectivity

Posted by Stephen Darlington <st...@gridgain.com>.
See the “Configuring Indexes using query entities” section of the documentation:  https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes#configuring-indexes-using-query-entities

Regards,
Stephen 

> On 16 Jan 2020, at 23:14, narges saleh <sn...@gmail.com> wrote:
> 
> 
> Thanks Stephan.
> 
> Can you send me an example where the cache and tables are entirely defined in the XML configuration file (and no POJO), with query entity or just JDBC? Let's assume that the sql codes run on a server node or a thick client.
> 
> 
>> On Thu, Jan 16, 2020 at 8:02 AM Stephen Darlington <st...@gridgain.com> wrote:
>> If you create a cache, either in code or XML, using the minimal list of parameter it won’t be accessible using SQL.
>> 
>> There are a number of ways you can define what’s visible using SQL. You can use a POJO with the @QuerySqlField annotation (and the indexTypes property in the XML file) or define QueryEntities. See the documentarian: https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes 
>> 
>> Whether you do it on the client or server side is a bit of a religious debate, but either works. The important thing is that the first definition to hit the cluster is the one that takes effect. 
>> 
>> The most common pattern I see with JDBC is the caches are defined server side, and clients connect using the thin-client driver. Thin clients just need a hostname and port.
>> 
>> However, there is also a thick-client JDBC driver. The XML here is no different from any other node.
>> 
>> Regards,
>> Stephen
>> 
>>> On 16 Jan 2020, at 12:54, narges saleh <sn...@gmail.com> wrote:
>>> 
>>> Thanks Ilya, Steve.
>>> 1) What do you mean by SQL enabled? Do I still need to define the POJO classes for the objects/tables?
>>> 2) Can I specify the caches including the table definitions entirely in XML config file and pass the config file to the JDBC connection? If yes, I'd greatly appreciate it if you provide some small samples. Please keep in mind that we have native persistence in place not a third party database.
>>> 
>>> 
>>> 
>>>> On Wed, Jan 15, 2020 at 7:29 AM Ilya Kasnacheev <il...@gmail.com> wrote:
>>>> Hello!
>>>> 
>>>> 4) I actually think that if you specify caches in thick client's config file, and they are absent on server, they will be created.
>>>> 
>>>> (However, they will not be changed if configuration differs)
>>>> 
>>>> Regards,
>>>> -- 
>>>> Ilya Kasnacheev
>>>> 
>>>> 
>>>> ср, 15 янв. 2020 г. в 15:59, narges saleh <sn...@gmail.com>:
>>>>> Hi All,
>>>>> 
>>>>> I am trying to use ignite's cache grid with native persistence and prefer to use JDBC for cache/db connectivity.
>>>>> 
>>>>> 1) Is this possible, in either client or server mode?
>>>>> 2) If yes, I assume, I'd need one JDBC connection per cache, as I see it is possible to specify only one cache per JDBC connection. Is this right?
>>>>> 3) Is this also true if I need to join multiple tables/caches?
>>>>> 4) Can I specify my caches in XML config file and just pass the config file to the JDBC connection?
>>>>> 5) Will I get the same load performance if I JDBC with streaming set to true as I'd using the streamer module directly (I see that I can specify most of the streamer config options on JDBC connection configuration)?
>>>>> 
>>>>> thanks.
>> 
>> 

Re: JDBC Connectivity

Posted by narges saleh <sn...@gmail.com>.
Thanks Stephan.

Can you send me an example where the cache and tables are entirely defined
in the XML configuration file (and no POJO), with query entity or just
JDBC? Let's assume that the sql codes run on a server node or a thick
client.


On Thu, Jan 16, 2020 at 8:02 AM Stephen Darlington <
stephen.darlington@gridgain.com> wrote:

> If you create a cache, either in code or XML, using the minimal list of
> parameter it won’t be accessible using SQL.
>
> There are a number of ways you can define what’s visible using SQL. You
> can use a POJO with the @QuerySqlField annotation (and the indexTypes
> property in the XML file) or define QueryEntities. See the documentarian:
> https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes
>
> Whether you do it on the client or server side is a bit of a religious
> debate, but either works. The important thing is that the first definition
> to hit the cluster is the one that takes effect.
>
> The most common pattern I see with JDBC is the caches are defined server
> side, and clients connect using the *thin-client* driver. Thin clients
> just need a hostname and port.
>
> However, there is also a thick-client JDBC driver. The XML here is no
> different from any other node.
>
> Regards,
> Stephen
>
> On 16 Jan 2020, at 12:54, narges saleh <sn...@gmail.com> wrote:
>
> Thanks Ilya, Steve.
> 1) What do you mean by SQL enabled? Do I still need to define the POJO
> classes for the objects/tables?
> 2) Can I specify the caches including the table definitions entirely in
> XML config file and pass the config file to the JDBC connection? If yes,
> I'd greatly appreciate it if you provide some small samples. Please keep in
> mind that we have native persistence in place not a third party database.
>
>
>
> On Wed, Jan 15, 2020 at 7:29 AM Ilya Kasnacheev <il...@gmail.com>
> wrote:
>
>> Hello!
>>
>> 4) I actually think that if you specify caches in thick client's config
>> file, and they are absent on server, they will be created.
>>
>> (However, they will not be changed if configuration differs)
>>
>> Regards,
>> --
>> Ilya Kasnacheev
>>
>>
>> ср, 15 янв. 2020 г. в 15:59, narges saleh <sn...@gmail.com>:
>>
>>> Hi All,
>>>
>>> I am trying to use ignite's cache grid with native persistence and
>>> prefer to use JDBC for cache/db connectivity.
>>>
>>> 1) Is this possible, in either client or server mode?
>>> 2) If yes, I assume, I'd need one JDBC connection per cache, as I see it
>>> is possible to specify only one cache per JDBC connection. Is this right?
>>> 3) Is this also true if I need to join multiple tables/caches?
>>> 4) Can I specify my caches in XML config file and just pass the config
>>> file to the JDBC connection?
>>> 5) Will I get the same load performance if I JDBC with streaming set to
>>> true as I'd using the streamer module directly (I see that I can specify
>>> most of the streamer config options on JDBC connection configuration)?
>>>
>>> thanks.
>>>
>>
>
>

Re: JDBC Connectivity

Posted by Stephen Darlington <st...@gridgain.com>.
If you create a cache, either in code or XML, using the minimal list of parameter it won’t be accessible using SQL.

There are a number of ways you can define what’s visible using SQL. You can use a POJO with the @QuerySqlField annotation (and the indexTypes property in the XML file) or define QueryEntities. See the documentarian: https://www.gridgain.com/docs/latest/developers-guide/SQL/indexes 

Whether you do it on the client or server side is a bit of a religious debate, but either works. The important thing is that the first definition to hit the cluster is the one that takes effect. 

The most common pattern I see with JDBC is the caches are defined server side, and clients connect using the thin-client driver. Thin clients just need a hostname and port.

However, there is also a thick-client JDBC driver. The XML here is no different from any other node.

Regards,
Stephen

> On 16 Jan 2020, at 12:54, narges saleh <sn...@gmail.com> wrote:
> 
> Thanks Ilya, Steve.
> 1) What do you mean by SQL enabled? Do I still need to define the POJO classes for the objects/tables?
> 2) Can I specify the caches including the table definitions entirely in XML config file and pass the config file to the JDBC connection? If yes, I'd greatly appreciate it if you provide some small samples. Please keep in mind that we have native persistence in place not a third party database.
> 
> 
> 
> On Wed, Jan 15, 2020 at 7:29 AM Ilya Kasnacheev <ilya.kasnacheev@gmail.com <ma...@gmail.com>> wrote:
> Hello!
> 
> 4) I actually think that if you specify caches in thick client's config file, and they are absent on server, they will be created.
> 
> (However, they will not be changed if configuration differs)
> 
> Regards,
> -- 
> Ilya Kasnacheev
> 
> 
> ср, 15 янв. 2020 г. в 15:59, narges saleh <snarges124@gmail.com <ma...@gmail.com>>:
> Hi All,
> 
> I am trying to use ignite's cache grid with native persistence and prefer to use JDBC for cache/db connectivity.
> 
> 1) Is this possible, in either client or server mode?
> 2) If yes, I assume, I'd need one JDBC connection per cache, as I see it is possible to specify only one cache per JDBC connection. Is this right?
> 3) Is this also true if I need to join multiple tables/caches?
> 4) Can I specify my caches in XML config file and just pass the config file to the JDBC connection?
> 5) Will I get the same load performance if I JDBC with streaming set to true as I'd using the streamer module directly (I see that I can specify most of the streamer config options on JDBC connection configuration)?
> 
> thanks.



Re: JDBC Connectivity

Posted by narges saleh <sn...@gmail.com>.
Thanks Ilya, Steve.
1) What do you mean by SQL enabled? Do I still need to define the POJO
classes for the objects/tables?
2) Can I specify the caches including the table definitions entirely in XML
config file and pass the config file to the JDBC connection? If yes, I'd
greatly appreciate it if you provide some small samples. Please keep in
mind that we have native persistence in place not a third party database.



On Wed, Jan 15, 2020 at 7:29 AM Ilya Kasnacheev <il...@gmail.com>
wrote:

> Hello!
>
> 4) I actually think that if you specify caches in thick client's config
> file, and they are absent on server, they will be created.
>
> (However, they will not be changed if configuration differs)
>
> Regards,
> --
> Ilya Kasnacheev
>
>
> ср, 15 янв. 2020 г. в 15:59, narges saleh <sn...@gmail.com>:
>
>> Hi All,
>>
>> I am trying to use ignite's cache grid with native persistence and prefer
>> to use JDBC for cache/db connectivity.
>>
>> 1) Is this possible, in either client or server mode?
>> 2) If yes, I assume, I'd need one JDBC connection per cache, as I see it
>> is possible to specify only one cache per JDBC connection. Is this right?
>> 3) Is this also true if I need to join multiple tables/caches?
>> 4) Can I specify my caches in XML config file and just pass the config
>> file to the JDBC connection?
>> 5) Will I get the same load performance if I JDBC with streaming set to
>> true as I'd using the streamer module directly (I see that I can specify
>> most of the streamer config options on JDBC connection configuration)?
>>
>> thanks.
>>
>

Re: JDBC Connectivity

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

4) I actually think that if you specify caches in thick client's config
file, and they are absent on server, they will be created.

(However, they will not be changed if configuration differs)

Regards,
-- 
Ilya Kasnacheev


ср, 15 янв. 2020 г. в 15:59, narges saleh <sn...@gmail.com>:

> Hi All,
>
> I am trying to use ignite's cache grid with native persistence and prefer
> to use JDBC for cache/db connectivity.
>
> 1) Is this possible, in either client or server mode?
> 2) If yes, I assume, I'd need one JDBC connection per cache, as I see it
> is possible to specify only one cache per JDBC connection. Is this right?
> 3) Is this also true if I need to join multiple tables/caches?
> 4) Can I specify my caches in XML config file and just pass the config
> file to the JDBC connection?
> 5) Will I get the same load performance if I JDBC with streaming set to
> true as I'd using the streamer module directly (I see that I can specify
> most of the streamer config options on JDBC connection configuration)?
>
> thanks.
>