Java Code Examples for org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor

The following examples show how to use org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: buffer-slayer   Source File: BatchJdbcTemplate.java    License: Apache License 2.0 4 votes vote down vote up
public void setNativeJdbcExtractor(NativeJdbcExtractor extractor) {
  delegate.setNativeJdbcExtractor(extractor);
}
 
Example 2
Source Project: buffer-slayer   Source File: BatchJdbcTemplate.java    License: Apache License 2.0 4 votes vote down vote up
public NativeJdbcExtractor getNativeJdbcExtractor() {
  return delegate.getNativeJdbcExtractor();
}
 
Example 3
/**
 * Specify the NativeJdbcExtractor to use for unwrapping CallableStatements, if any.
 */
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.nativeJdbcExtractor = nativeJdbcExtractor;
}
 
Example 4
Source Project: lams   Source File: JdbcTemplate.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return the current NativeJdbcExtractor implementation.
 */
public NativeJdbcExtractor getNativeJdbcExtractor() {
	return this.nativeJdbcExtractor;
}
 
Example 5
@Override
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.nativeJdbcExtractor = nativeJdbcExtractor;
}
 
Example 6
protected NativeJdbcExtractor getNativeJdbcExtractor() {
	return this.nativeJdbcExtractor;
}
 
Example 7
Source Project: lams   Source File: TableMetaDataContext.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Set {@link NativeJdbcExtractor} to be used to retrieve the native connection.
 */
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.nativeJdbcExtractor = nativeJdbcExtractor;
}
 
Example 8
/**
 * Create a TableMetaDataProvider based on the database metadata.
 * @param dataSource used to retrieve metadata
 * @param context the class that holds configuration and metadata
 * @param nativeJdbcExtractor the NativeJdbcExtractor to be used
 * @return instance of the TableMetaDataProvider implementation to be used
 */
public static TableMetaDataProvider createMetaDataProvider(DataSource dataSource,
			final TableMetaDataContext context, final NativeJdbcExtractor nativeJdbcExtractor) {
	try {
		return (TableMetaDataProvider) JdbcUtils.extractDatabaseMetaData(dataSource,
				new DatabaseMetaDataCallback() {
					@Override
					public Object processMetaData(DatabaseMetaData databaseMetaData) throws SQLException {
						String databaseProductName =
								JdbcUtils.commonDatabaseName(databaseMetaData.getDatabaseProductName());
						boolean accessTableColumnMetaData = context.isAccessTableColumnMetaData();
						TableMetaDataProvider provider;
						if ("Oracle".equals(databaseProductName)) {
							provider = new OracleTableMetaDataProvider(databaseMetaData,
									context.isOverrideIncludeSynonymsDefault());
						}
						else if ("HSQL Database Engine".equals(databaseProductName)) {
							provider = new HsqlTableMetaDataProvider(databaseMetaData);
						}
						else if ("PostgreSQL".equals(databaseProductName)) {
							provider = new PostgresTableMetaDataProvider(databaseMetaData);
						}
						else if ("Apache Derby".equals(databaseProductName)) {
							provider = new DerbyTableMetaDataProvider(databaseMetaData);
						}
						else {
							provider = new GenericTableMetaDataProvider(databaseMetaData);
						}
						if (nativeJdbcExtractor != null) {
							provider.setNativeJdbcExtractor(nativeJdbcExtractor);
						}
						if (logger.isDebugEnabled()) {
							logger.debug("Using " + provider.getClass().getSimpleName());
						}
						provider.initializeWithMetaData(databaseMetaData);
						if (accessTableColumnMetaData) {
							provider.initializeWithTableColumnMetaData(databaseMetaData, context.getCatalogName(),
									context.getSchemaName(), context.getTableName());
						}
						return provider;
					}
				});
	}
	catch (MetaDataAccessException ex) {
		throw new DataAccessResourceFailureException("Error retrieving database metadata", ex);
	}
}
 
Example 9
/**
 * Specify the NativeJdbcExtractor to use for unwrapping PreparedStatements, if any.
 */
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.nativeJdbcExtractor = nativeJdbcExtractor;
}
 
Example 10
Source Project: lams   Source File: AbstractJdbcInsert.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Set the {@link NativeJdbcExtractor} to use to retrieve the native connection if necessary
 */
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.tableMetaDataContext.setNativeJdbcExtractor(nativeJdbcExtractor);
}
 
Example 11
Source Project: lams   Source File: SimpleJdbcInsert.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public SimpleJdbcInsertOperations useNativeJdbcExtractorForMetaData(NativeJdbcExtractor nativeJdbcExtractor) {
	setNativeJdbcExtractor(nativeJdbcExtractor);
	return this;
}
 
Example 12
/**
 * Specify the NativeJdbcExtractor to use for unwrapping CallableStatements, if any.
 */
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.nativeJdbcExtractor = nativeJdbcExtractor;
}
 
Example 13
Source Project: spring4-understanding   Source File: JdbcTemplate.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Return the current NativeJdbcExtractor implementation.
 */
public NativeJdbcExtractor getNativeJdbcExtractor() {
	return this.nativeJdbcExtractor;
}
 
Example 14
@Override
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.nativeJdbcExtractor = nativeJdbcExtractor;
}
 
Example 15
protected NativeJdbcExtractor getNativeJdbcExtractor() {
	return this.nativeJdbcExtractor;
}
 
Example 16
/**
 * Set {@link NativeJdbcExtractor} to be used to retrieve the native connection.
 */
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.nativeJdbcExtractor = nativeJdbcExtractor;
}
 
Example 17
/**
 * Create a TableMetaDataProvider based on the database metedata
 * @param dataSource used to retrieve metedata
 * @param context the class that holds configuration and metedata
 * @param nativeJdbcExtractor the NativeJdbcExtractor to be used
 * @return instance of the TableMetaDataProvider implementation to be used
 */
public static TableMetaDataProvider createMetaDataProvider(DataSource dataSource,
			final TableMetaDataContext context, final NativeJdbcExtractor nativeJdbcExtractor) {
	try {
		return (TableMetaDataProvider) JdbcUtils.extractDatabaseMetaData(dataSource,
				new DatabaseMetaDataCallback() {
					@Override
					public Object processMetaData(DatabaseMetaData databaseMetaData) throws SQLException {
						String databaseProductName =
								JdbcUtils.commonDatabaseName(databaseMetaData.getDatabaseProductName());
						boolean accessTableColumnMetaData = context.isAccessTableColumnMetaData();
						TableMetaDataProvider provider;
						if ("Oracle".equals(databaseProductName)) {
							provider = new OracleTableMetaDataProvider(databaseMetaData,
									context.isOverrideIncludeSynonymsDefault());
						}
						else if ("HSQL Database Engine".equals(databaseProductName)) {
							provider = new HsqlTableMetaDataProvider(databaseMetaData);
						}
						else if ("PostgreSQL".equals(databaseProductName)) {
							provider = new PostgresTableMetaDataProvider(databaseMetaData);
						}
						else if ("Apache Derby".equals(databaseProductName)) {
							provider = new DerbyTableMetaDataProvider(databaseMetaData);
						}
						else {
							provider = new GenericTableMetaDataProvider(databaseMetaData);
						}
						if (nativeJdbcExtractor != null) {
							provider.setNativeJdbcExtractor(nativeJdbcExtractor);
						}
						if (logger.isDebugEnabled()) {
							logger.debug("Using " + provider.getClass().getSimpleName());
						}
						provider.initializeWithMetaData(databaseMetaData);
						if (accessTableColumnMetaData) {
							provider.initializeWithTableColumnMetaData(databaseMetaData, context.getCatalogName(),
									context.getSchemaName(), context.getTableName());
						}
						return provider;
					}
				});
	}
	catch (MetaDataAccessException ex) {
		throw new DataAccessResourceFailureException("Error retrieving database metadata", ex);
	}
}
 
Example 18
/**
 * Specify the NativeJdbcExtractor to use for unwrapping PreparedStatements, if any.
 */
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.nativeJdbcExtractor = nativeJdbcExtractor;
}
 
Example 19
Source Project: spring4-understanding   Source File: AbstractJdbcInsert.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Set the {@link NativeJdbcExtractor} to use to retrieve the native connection if necessary
 */
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.tableMetaDataContext.setNativeJdbcExtractor(nativeJdbcExtractor);
}
 
Example 20
Source Project: spring4-understanding   Source File: SimpleJdbcInsert.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public SimpleJdbcInsertOperations useNativeJdbcExtractorForMetaData(NativeJdbcExtractor nativeJdbcExtractor) {
	setNativeJdbcExtractor(nativeJdbcExtractor);
	return this;
}
 
Example 21
Source Project: kratos-1   Source File: KratosJdbcTemplate.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setNativeJdbcExtractor(NativeJdbcExtractor extractor) {
	super.setNativeJdbcExtractor(extractor);
}
 
Example 22
Source Project: kratos-1   Source File: KratosJdbcTemplate.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public NativeJdbcExtractor getNativeJdbcExtractor() {
	return super.getNativeJdbcExtractor();
}
 
Example 23
/**
 * Specify the NativeJdbcExtractor to use for unwrapping CallableStatements, if any.
 */
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.nativeJdbcExtractor = nativeJdbcExtractor;
}
 
Example 24
Source Project: effectivejava   Source File: JdbcTemplate.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Return the current NativeJdbcExtractor implementation.
 */
public NativeJdbcExtractor getNativeJdbcExtractor() {
	return this.nativeJdbcExtractor;
}
 
Example 25
@Override
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.nativeJdbcExtractor = nativeJdbcExtractor;
}
 
Example 26
protected NativeJdbcExtractor getNativeJdbcExtractor() {
	return this.nativeJdbcExtractor;
}
 
Example 27
Source Project: effectivejava   Source File: TableMetaDataContext.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Set {@link NativeJdbcExtractor} to be used to retrieve the native connection.
 */
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.nativeJdbcExtractor = nativeJdbcExtractor;
}
 
Example 28
/**
 * Create a TableMetaDataProvider based on the database metedata
 * @param dataSource used to retrieve metedata
 * @param context the class that holds configuration and metedata
 * @param nativeJdbcExtractor the NativeJdbcExtractor to be used
 * @return instance of the TableMetaDataProvider implementation to be used
 */
public static TableMetaDataProvider createMetaDataProvider(DataSource dataSource,
			final TableMetaDataContext context, final NativeJdbcExtractor nativeJdbcExtractor) {
	try {
		return (TableMetaDataProvider) JdbcUtils.extractDatabaseMetaData(dataSource,
				new DatabaseMetaDataCallback() {
					@Override
					public Object processMetaData(DatabaseMetaData databaseMetaData) throws SQLException {
						String databaseProductName =
								JdbcUtils.commonDatabaseName(databaseMetaData.getDatabaseProductName());
						boolean accessTableColumnMetaData = context.isAccessTableColumnMetaData();
						TableMetaDataProvider provider;
						if ("Oracle".equals(databaseProductName)) {
							provider = new OracleTableMetaDataProvider(databaseMetaData,
									context.isOverrideIncludeSynonymsDefault());
						}
						else if ("HSQL Database Engine".equals(databaseProductName)) {
							provider = new HsqlTableMetaDataProvider(databaseMetaData);
						}
						else if ("PostgreSQL".equals(databaseProductName)) {
							provider = new PostgresTableMetaDataProvider(databaseMetaData);
						}
						else if ("Apache Derby".equals(databaseProductName)) {
							provider = new DerbyTableMetaDataProvider(databaseMetaData);
						}
						else {
							provider = new GenericTableMetaDataProvider(databaseMetaData);
						}
						if (nativeJdbcExtractor != null) {
							provider.setNativeJdbcExtractor(nativeJdbcExtractor);
						}
						if (logger.isDebugEnabled()) {
							logger.debug("Using " + provider.getClass().getSimpleName());
						}
						provider.initializeWithMetaData(databaseMetaData);
						if (accessTableColumnMetaData) {
							provider.initializeWithTableColumnMetaData(databaseMetaData, context.getCatalogName(),
									context.getSchemaName(), context.getTableName());
						}
						return provider;
					}
				});
	}
	catch (MetaDataAccessException ex) {
		throw new DataAccessResourceFailureException("Error retrieving database metadata", ex);
	}
}
 
Example 29
/**
 * Specify the NativeJdbcExtractor to use for unwrapping PreparedStatements, if any.
 */
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.nativeJdbcExtractor = nativeJdbcExtractor;
}
 
Example 30
Source Project: effectivejava   Source File: AbstractJdbcInsert.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Set the {@link NativeJdbcExtractor} to use to retrieve the native connection if necessary
 */
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
	this.tableMetaDataContext.setNativeJdbcExtractor(nativeJdbcExtractor);
}