gt: 		return new SqlParameter(parameterName, meta.getSqlType());
context: /*
   * Copyright 2002-2017 the original author or authors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.springframework.jdbc.core.metadata;
  
  import java.sql.DatabaseMetaData;
  import java.sql.ResultSet;
  import java.sql.SQLException;
  import java.sql.Types;
  import java.util.ArrayList;
  import java.util.List;
  
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  
  import org.springframework.dao.InvalidDataAccessApiUsageException;
  import org.springframework.jdbc.core.SqlInOutParameter;
  import org.springframework.jdbc.core.SqlOutParameter;
  import org.springframework.jdbc.core.SqlParameter;
  import org.springframework.util.StringUtils;
  
  /**
   * Generic implementation for the {@link CallMetaDataProvider} interface.
   * This class can be extended to provide database specific behavior.
   *
   * @author Thomas Risberg
   * @since 2.5
   */
  public class GenericCallMetaDataProvider implements CallMetaDataProvider {
  
  	/** Logger available to subclasses */
  	protected static final Log logger = LogFactory.getLog(CallMetaDataProvider.class);
  
  	private boolean procedureColumnMetaDataUsed = false;
  
  	private String userName;
  
  	private boolean supportsCatalogsInProcedureCalls = true;
  
  	private boolean supportsSchemasInProcedureCalls = true;
  
  	private boolean storesUpperCaseIdentifiers = true;
  
  	private boolean storesLowerCaseIdentifiers = false;
  
  	private List<CallParameterMetaData> callParameterMetaData = new ArrayList<CallParameterMetaData>();
  
  
  	/**
  	 * Constructor used to initialize with provided database meta data.
  	 * @param databaseMetaData meta data to be used
  	 */
  	protected GenericCallMetaDataProvider(DatabaseMetaData databaseMetaData) throws SQLException {
  		this.userName = databaseMetaData.getUserName();
  	}
  
  
  	@Override
  	public void initializeWithMetaData(DatabaseMetaData databaseMetaData) throws SQLException {
  		try {
  			setSupportsCatalogsInProcedureCalls(databaseMetaData.supportsCatalogsInProcedureCalls());
  		}
  		catch (SQLException ex) {
  			if (logger.isWarnEnabled()) {
  				logger.warn("Error retrieving 'DatabaseMetaData.supportsCatalogsInProcedureCalls': " + ex.getMessage());
  			}
  		}
  		try {
  			setSupportsSchemasInProcedureCalls(databaseMetaData.supportsSchemasInProcedureCalls());
  		}
  		catch (SQLException ex) {
  			if (logger.isWarnEnabled()) {
  				logger.warn("Error retrieving 'DatabaseMetaData.supportsSchemasInProcedureCalls': " + ex.getMessage());
  			}
  		}
  		try {
  			setStoresUpperCaseIdentifiers(databaseMetaData.storesUpperCaseIdentifiers());
  		}
  		catch (SQLException ex) {
  			if (logger.isWarnEnabled()) {
  				logger.warn("Error retrieving 'DatabaseMetaData.storesUpperCaseIdentifiers': " + ex.getMessage());
  			}
  		}
  		try {
  			setStoresLowerCaseIdentifiers(databaseMetaData.storesLowerCaseIdentifiers());
  		}
  		catch (SQLException ex) {
  			if (logger.isWarnEnabled()) {
  				logger.warn("Error retrieving 'DatabaseMetaData.storesLowerCaseIdentifiers': " + ex.getMessage());
  			}
  		}
  	}
  
  	@Override
  	public void initializeWithProcedureColumnMetaData(DatabaseMetaData databaseMetaData, String catalogName,
  			String schemaName, String procedureName) throws SQLException {
  
  		this.procedureColumnMetaDataUsed = true;
  		processProcedureColumns(databaseMetaData, catalogName, schemaName,  procedureName);
  	}
  
  	@Override
  	public List<CallParameterMetaData> getCallParameterMetaData() {
  		return this.callParameterMetaData;
  	}
  
  	@Override
  	public String procedureNameToUse(String procedureName) {
  		if (procedureName == null) {
  			return null;
  		}
  		else if (isStoresUpperCaseIdentifiers()) {
  			return procedureName.toUpperCase();
  		}
  		else if (isStoresLowerCaseIdentifiers()) {
  			return procedureName.toLowerCase();
  		}
  		else {
  			return procedureName;
  		}
  	}
  
  	@Override
  	public String catalogNameToUse(String catalogName) {
  		if (catalogName == null) {
  			return null;
  		}
  		else if (isStoresUpperCaseIdentifiers()) {
  			return catalogName.toUpperCase();
  		}
  		else if (isStoresLowerCaseIdentifiers()) {
  			return catalogName.toLowerCase();
  		}
  		else {
  			return catalogName;
  		}
  	}
  
  	@Override
  	public String schemaNameToUse(String schemaName) {
  		if (schemaName == null) {
  			return null;
  		}
  		else if (isStoresUpperCaseIdentifiers()) {
  			return schemaName.toUpperCase();
  		}
  		else if (isStoresLowerCaseIdentifiers()) {
  			return schemaName.toLowerCase();
  		}
  		else {
  			return schemaName;
  		}
  	}
  
  	@Override
  	public String metaDataCatalogNameToUse(String catalogName) {
  		if (isSupportsCatalogsInProcedureCalls()) {
  			return catalogNameToUse(catalogName);
  		}
  		else {
  			return null;
  		}
  	}
  
  	@Override
  	public String metaDataSchemaNameToUse(String schemaName) {
  		if (isSupportsSchemasInProcedureCalls()) {
  			return schemaNameToUse(schemaName);
  		}
  		else {
  			return null;
  		}
  	}
  
  	@Override
  	public String parameterNameToUse(String parameterName) {
  		if (parameterName == null) {
  			return null;
  		}
  		else if (isStoresUpperCaseIdentifiers()) {
  			return parameterName.toUpperCase();
  		}
  		else if (isStoresLowerCaseIdentifiers()) {
  			return parameterName.toLowerCase();
  		}
  		else {
  			return parameterName;
  		}
  	}
  
  	@Override
  	public boolean byPassReturnParameter(String parameterName) {
  		return false;
  	}
  
  	@Override
  	public SqlParameter createDefaultOutParameter(String parameterName, CallParameterMetaData meta) {
  		return new SqlOutParameter(parameterName, meta.getSqlType());
  	}
  
  	@Override
  	public SqlParameter createDefaultInOutParameter(String parameterName, CallParameterMetaData meta) {
  		return new SqlInOutParameter(parameterName, meta.getSqlType());
  	}
  
  	@Override
  	public SqlParameter createDefaultInParameter(String parameterName, CallParameterMetaData meta) {
  