SpaceDataSourceSplitter
instead.@Deprecated public class SQLDataProviderSplitter extends BulkDataPersisterSplitter implements SQLDataProvider
dataSources
NUMBER_OF_PARTITIONS, STATIC_PARTITION_NUMBER
Constructor and Description |
---|
SQLDataProviderSplitter(ManagedDataSourceEntriesProvider[] dataSources)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
DataIterator |
iterator(SQLQuery sqlQuery)
Deprecated.
Create an iterator over all objects that match the given
SQLQuery . |
executeBulk
getDataSource, init, initialLoad, setInitalLoadThreadPoolSize, shutdown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init, initialLoad, shutdown
public SQLDataProviderSplitter(ManagedDataSourceEntriesProvider[] dataSources)
public DataIterator iterator(SQLQuery sqlQuery) throws DataSourceException
SQLDataProvider
Create an iterator over all objects that match the givenSQLQuery
. SQLQuery contains a string representation of SQL 'where' clause. The format matches thePreparedStatement
format(field1 = ? and field2 > ? and ....). The prepared values are accessible bySQLQuery
.getPreparedValues() method Example implementation with SQL PreparedStatement:PreparedStatement st = con.prepareStatement(query.getSelectAllQuery()); int index = 0; if(query.hasPreparedValues()) { for(Iterator iter = query.getPreparedValues().iterator();iter.hasNext()) { st.setObject(++index,iter.next()); } } ResultSet rs = st.executeQuery(); return new ResultSetIterator(rs);
iterator
in interface SQLDataProvider
DataIterator
or null if no data was found that match the given templateDataSourceException
Copyright © GigaSpaces.