@Test(expected = IOException.class) public void testCheckAllInsertedPositive() throws IOException { JDBCDataStore.checkAllInserted(new int[0], 0); JDBCDataStore.checkAllInserted(new int[] {1, 1, 1}, 3); JDBCDataStore.checkAllInserted(new int[] {3}, 3); JDBCDataStore.checkAllInserted(new int[] {1, 1, 0}, 3); }
static void checkAllInserted(int[] inserts, int size) throws IOException { int sum = 0; for (int cur : inserts) { if (cur == PreparedStatement.SUCCESS_NO_INFO) { return; } else if (cur == PreparedStatement.EXECUTE_FAILED) { throw new IOException("Failed to insert some features"); } sum += cur; } if (sum != size) { throw new IOException("Failed to insert some features"); } }
JDBCDataStore extends ContentDataStore implements GmlObjectStore { static void checkAllInserted(int[] inserts, int size) throws IOException { int sum = 0; for (int cur : inserts) { if (cur == PreparedStatement.SUCCESS_NO_INFO) { return; } else if (cur == PreparedStatement.EXECUTE_FAILED) { throw new IOException("Failed to insert some features"); } sum += cur; } if (sum != size) { throw new IOException("Failed to insert some features"); } } }
JDBCDataStore extends ContentDataStore implements GmlObjectStore { static void checkAllInserted(int[] inserts, int size) throws IOException { int sum = 0; for (int cur : inserts) { if (cur == PreparedStatement.SUCCESS_NO_INFO) { return; } else if (cur == PreparedStatement.EXECUTE_FAILED) { throw new IOException("Failed to insert some features"); } sum += cur; } if (sum != size) { throw new IOException("Failed to insert some features"); } } JDBCDataStore(); }
JDBCDataStore extends ContentDataStore implements GmlObjectStore { static void checkAllInserted(int[] inserts, int size) throws IOException { int sum = 0; for (int cur : inserts) { if (cur == PreparedStatement.SUCCESS_NO_INFO) { return; } else if (cur == PreparedStatement.EXECUTE_FAILED) { throw new IOException("Failed to insert some features"); } sum += cur; } if (sum != size) { throw new IOException("Failed to insert some features"); } } JDBCDataStore(); void setCallbackFactory(JDBCCallbackFactory factory); JDBCCallbackFactory getCallbackFactory(); JDBCFeatureSource getAbsoluteFeatureSource(String typeName); void createVirtualTable(VirtualTable vtable); List<ConnectionLifecycleListener> getConnectionLifecycleListeners(); VirtualTable dropVirtualTable(String name); Map<String, VirtualTable> getVirtualTables(); PrimaryKeyFinder getPrimaryKeyFinder(); void setPrimaryKeyFinder(PrimaryKeyFinder primaryKeyFinder); int getFetchSize(); void setFetchSize(int fetchSize); int getBatchInsertSize(); void setBatchInsertSize(int batchInsertSize); boolean isExposePrimaryKeyColumns(); void setExposePrimaryKeyColumns(boolean exposePrimaryKeyColumns); SQLDialect getSQLDialect(); void setSQLDialect(SQLDialect dialect); DataSource getDataSource(); void setDataSource(DataSource dataSource); String getDatabaseSchema(); void setDatabaseSchema(String databaseSchema); FilterCapabilities getFilterCapabilities(); boolean isAssociations(); void setAssociations(boolean foreignKeyGeometries); Map<Integer, Class<?>> getSqlTypeToClassMappings(); Map<String, Class<?>> getSqlTypeNameToClassMappings(); Map<Class<?>, Integer> getClassToSqlTypeMappings(); Map<Integer, String> getSqlTypeToSqlTypeNameOverrides(); ConcurrentHashMap<Integer, String> getDBsqlTypesCache(); Map<Class<? extends FeatureVisitor>, String> getAggregateFunctions(); Class<?> getMapping(int sqlType); Class<?> getMapping(String sqlTypeName); Integer getMapping(Class<?> clazz); void createSchema(final SimpleFeatureType featureType); void removeSchema(String typeName); void removeSchema(Name typeName); Object getGmlObject(GmlObjectId id, Hints hints); PrimaryKey getPrimaryKey(SimpleFeatureType featureType); Connection getConnection(Transaction t); static List<Object> decodeFID(PrimaryKey key, String FID, boolean strict); void setPreparedFilterValues(
            PreparedStatement ps, PreparedFilterToSQL toSQL, int offset, Connection cx); FilterToSQL createFilterToSQL(SimpleFeatureType featureType); PreparedFilterToSQL createPreparedFilterToSQL(SimpleFeatureType featureType); void encodeTableName(String tableName, StringBuffer sql, Hints hints); void encodeAliasedTableName(
            String tableName, StringBuffer sql, Hints hints, String alias); void applyLimitOffset(StringBuffer sql, Query query); void closeSafe(ResultSet rs); void closeSafe(Statement st); void closeSafe(Connection cx); void dispose(); void encodeGeometryColumn(GeometryDescriptor gatt, StringBuffer sql, Hints hints); Transaction buildTransaction(Connection cx); void createIndex(Index index); void dropIndex(String typeName, String indexName); List<Index> getIndexes(String typeName); String escapeNamePattern(DatabaseMetaData metaData, String name); }
JDBCDataStore extends ContentDataStore implements GmlObjectStore { static void checkAllInserted(int[] inserts, int size) throws IOException { int sum = 0; for (int cur : inserts) { if (cur == PreparedStatement.SUCCESS_NO_INFO) { return; } else if (cur == PreparedStatement.EXECUTE_FAILED) { throw new IOException("Failed to insert some features"); } sum += cur; } if (sum != size) { throw new IOException("Failed to insert some features"); } } JDBCDataStore(); void setCallbackFactory(JDBCCallbackFactory factory); JDBCCallbackFactory getCallbackFactory(); JDBCFeatureSource getAbsoluteFeatureSource(String typeName); void createVirtualTable(VirtualTable vtable); List<ConnectionLifecycleListener> getConnectionLifecycleListeners(); VirtualTable dropVirtualTable(String name); Map<String, VirtualTable> getVirtualTables(); PrimaryKeyFinder getPrimaryKeyFinder(); void setPrimaryKeyFinder(PrimaryKeyFinder primaryKeyFinder); int getFetchSize(); void setFetchSize(int fetchSize); int getBatchInsertSize(); void setBatchInsertSize(int batchInsertSize); boolean isExposePrimaryKeyColumns(); void setExposePrimaryKeyColumns(boolean exposePrimaryKeyColumns); SQLDialect getSQLDialect(); void setSQLDialect(SQLDialect dialect); DataSource getDataSource(); void setDataSource(DataSource dataSource); String getDatabaseSchema(); void setDatabaseSchema(String databaseSchema); FilterCapabilities getFilterCapabilities(); boolean isAssociations(); void setAssociations(boolean foreignKeyGeometries); Map<Integer, Class<?>> getSqlTypeToClassMappings(); Map<String, Class<?>> getSqlTypeNameToClassMappings(); Map<Class<?>, Integer> getClassToSqlTypeMappings(); Map<Integer, String> getSqlTypeToSqlTypeNameOverrides(); ConcurrentHashMap<Integer, String> getDBsqlTypesCache(); Map<Class<? extends FeatureVisitor>, String> getAggregateFunctions(); Class<?> getMapping(int sqlType); Class<?> getMapping(String sqlTypeName); Integer getMapping(Class<?> clazz); void createSchema(final SimpleFeatureType featureType); void removeSchema(String typeName); void removeSchema(Name typeName); Object getGmlObject(GmlObjectId id, Hints hints); PrimaryKey getPrimaryKey(SimpleFeatureType featureType); Connection getConnection(Transaction t); static List<Object> decodeFID(PrimaryKey key, String FID, boolean strict); void setPreparedFilterValues(
            PreparedStatement ps, PreparedFilterToSQL toSQL, int offset, Connection cx); FilterToSQL createFilterToSQL(SimpleFeatureType featureType); PreparedFilterToSQL createPreparedFilterToSQL(SimpleFeatureType featureType); void encodeTableName(String tableName, StringBuffer sql, Hints hints); void encodeAliasedTableName(
            String tableName, StringBuffer sql, Hints hints, String alias); void applyLimitOffset(StringBuffer sql, Query query); void closeSafe(ResultSet rs); void closeSafe(Statement st); void closeSafe(Connection cx); void dispose(); void encodeGeometryColumn(GeometryDescriptor gatt, StringBuffer sql, Hints hints); Transaction buildTransaction(Connection cx); void createIndex(Index index); void dropIndex(String typeName, String indexName); List<Index> getIndexes(String typeName); String escapeNamePattern(DatabaseMetaData metaData, String name); static final String JDBC_NATIVE_SRID; static final String JDBC_READ_ONLY; static final String JDBC_PRIMARY_KEY_COLUMN; static final String JDBC_NATIVE_TYPENAME; static final String JDBC_NATIVE_TYPE; static final String JDBC_COLUMN_ALIAS; static final String JDBC_ENUM_MAP; static final int MAX_IDS_IN_FILTER; public SQLDialect dialect; public int fetchSize; }