[id='jdbc_cache_store_config']
= JDBC String-Based Cache Store Configuration
You can configure `JdbcStringBasedStore` programmatically or declaratively.

.Declarative configuration

* Using `PooledConnectionFactory`

[source,xml,options="nowrap",subs=attributes+]
----
include::config_examples/persistence_example_jdbc.xml[]
----

* Using `ManagedConnectionFactory`

[source,xml,options="nowrap",subs=attributes+]
----
include::config_examples/persistence_example_ds_jndi.xml[]
----

.Programmatic configuration

* Using `PooledConnectionFactory`

[source,java]
----
include::code_examples/PersistenceJdbcStringBasedStore.java[]
----

* Using `ManagedConnectionFactory`

[source,java]
----
include::code_examples/PersistenceDatasourceJndi.java[]
----

.Reference

* link:{configdocroot}infinispan-cachestore-jdbc-config-{schemaversion}.html[JDBC cache store configuration schema]
* link:{javadocroot}/org/infinispan/persistence/jdbc/stringbased/JdbcStringBasedStore.html[JdbcStringBasedStore]
* link:{javadocroot}/org/infinispan/persistence/jdbc/configuration/JdbcStringBasedStoreConfiguration.html[JdbcStringBasedStoreConfiguration]
