Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-13796

Document an example for table-jdbc-store with RUNSCRIPT

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • Minor
    • None
    • 13.0.8.Final, 14.0.0.Dev02
    • Documentation
    • None

    Description

      Document an example for table-jdbc-store with RUNSCRIPT

         <cache-container name="default" statistics="true">
            <transport cluster="${infinispan.cluster.name:cluster}" stack="${infinispan.cluster.stack:tcp}" node-name="${infinispan.node.name:}"/>
            <security>
               <authorization/>
            </security>
            <distributed-cache name="cache-table-jdbc-store">
               <encoding>
                  <key media-type="application/x-protostream"/>
                  <value media-type="application/x-protostream"/>
               </encoding>
               <persistence>
                  <table-jdbc-store xmlns="urn:infinispan:config:store:sql:13.0" dialect="H2" shared="false" table-name="REGISTRATION">
                     <connection-pool connection-url="jdbc:h2:mem:cache-table-jdbc-store;INIT=RUNSCRIPT FROM '/path/to/create_tables.sql';" username="sa" password="changeme" driver="org.h2.Driver"/>
                  </table-jdbc-store>
               </persistence>
            </distributed-cache>
      

      create_tables.sql

      CREATE TABLE REGISTRATION
      (id INTEGER not NULL,
      first VARCHAR(255),
      last VARCHAR(255),
      age INTEGER,
      PRIMARY KEY ( id ))
      

      In the example, explain that the goal of table-jdbc-store is for pre-existed tables

      Attachments

        Activity

          People

            Unassigned Unassigned
            dlovison@redhat.com Diego Lovison
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: