|Caching Data with GemFire XD / Using a RowLoader to Load Existing Data|
The JDBCRowLoader class provide a sample RowLoader implementation that loads data from archive relational data stores.
A query-string parameter is passed to the JDBCRowLoader to tell it what SQL statement to use against the archive database. This is a required parameter.
If the column layout of the archive table matches the column layout of the GemFire XD table, you can use SELECT * in the query string.
If the column layout of the archive table does not match the column layout of the GemFire XD table, you must explicitly provide and order the column names in the SELECT statement so that the result set matches the layout of the GemFire XD table.
There is no requirement that the schema or table name in GemFire XD match the schema and/or table name in the archive database.
The elements of the primary key are passed into the JDBCRowLoader when it is invoked, in the order that the columns are defined in the GemFire XD table. They will be passed as parameters into the PreparedStatement in that order, so you must structure the WHERE clause of the query-string so that the elements are passed in the correct order.
All properties are also passed to the JDBC connection when it is created.
GemFire XD installs a sample JDBCRowLoader implementation in Pivotal_GemFireXD_10_bNNNNN/examples/JDBCRowLoader.java. Note that this example requires gemfire.jar (from the Pivotal GemFire product) in order to run.