GigaSpaces XAP 9.7.2 API

org.openspaces.persistency.patterns
Class SQLDataProviderExceptionHandler

java.lang.Object
  extended by org.openspaces.persistency.patterns.AbstractManagedDataSourceDelegator
      extended by org.openspaces.persistency.patterns.BulkDataPersisterExceptionHandler
          extended by org.openspaces.persistency.patterns.SQLDataProviderExceptionHandler
All Implemented Interfaces:
BulkDataPersister, ManagedDataSource, SQLDataProvider

Deprecated. since 9.5 - use SpaceDataSourceExceptionHandler instead.

@Deprecated
public class SQLDataProviderExceptionHandler
extends BulkDataPersisterExceptionHandler
implements SQLDataProvider

Author:
kimchy

Field Summary
 
Fields inherited from class org.openspaces.persistency.patterns.BulkDataPersisterExceptionHandler
exceptionHandler
 
Fields inherited from class org.openspaces.persistency.patterns.AbstractManagedDataSourceDelegator
dataSource
 
Fields inherited from interface com.gigaspaces.datasource.ManagedDataSource
DATA_CLASS_PROPS, NUMBER_OF_PARTITIONS, STATIC_PARTITION_NUMBER
 
Constructor Summary
SQLDataProviderExceptionHandler(ManagedDataSource dataSource, ExceptionHandler exceptionHandler)
          Deprecated.  
 
Method Summary
 DataIterator iterator(SQLQuery sqlQuery)
          Deprecated.  Create an iterator over all objects that match the given SQLQuery.
 
Methods inherited from class org.openspaces.persistency.patterns.BulkDataPersisterExceptionHandler
executeBulk
 
Methods inherited from class org.openspaces.persistency.patterns.AbstractManagedDataSourceDelegator
init, initialLoad, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.gigaspaces.datasource.ManagedDataSource
init, initialLoad, shutdown
 

Constructor Detail

SQLDataProviderExceptionHandler

public SQLDataProviderExceptionHandler(ManagedDataSource dataSource,
                                       ExceptionHandler exceptionHandler)
Deprecated. 
Method Detail

iterator

public DataIterator iterator(SQLQuery sqlQuery)
                      throws DataSourceException
Deprecated. 
Description copied from interface: SQLDataProvider
 Create an iterator over all objects that match the given SQLQuery.
 SQLQuery contains a string representation of SQL 'where' clause.
 The format matches the PreparedStatement format(field1 = ? and field2 > ? and ....).
 The prepared values are accessible by SQLQuery.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);
 
 

Specified by:
iterator in interface SQLDataProvider
Returns:
a DataIterator or null if no data was found that match the given template
Throws:
DataSourceException

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.