public int updateCache ( DatabaseMetaData metaData , String catalogName , String schemaName , String procedureName ) throws SQLException { String dbProductName = MetadataUtils . processDatabaseProductName ( metaData . getDatabaseProductName ( ) ) ; ResultSet procedures = null ; ResultSet procedureParameters = null ; List < String > proceduresList = new ArrayList < String > ( ) ; String procedureCatalog = null ; String procedureSchema = null ; String procedureNameFull = null ; String procedureParameterName = null ; Integer procedureParameterDirection = null ; Integer procedureParameterType = null ; QueryParameters . Direction direction = null ; QueryParameters procedureParams = null ; StoredProcedure procedurePath = null ; procedures = metaData . getProcedures ( catalogName , schemaName , procedureName ) ; while ( procedures . next ( ) == true ) { procedureCatalog = procedures . getString ( "PROCEDURE_CAT" ) ; procedureSchema = procedures . getString ( "PROCEDURE_SCHEM" ) ; procedureNameFull = processProcedureName ( dbProductName , procedures . getString ( "PROCEDURE_NAME" ) ) ; procedurePath = new StoredProcedure ( procedureCatalog , procedureSchema , procedureNameFull ) ; procedureParameters = metaData . getProcedureColumns ( procedureCatalog , procedureSchema , procedureNameFull , null ) ; proceduresList . add ( procedureCatalog + "." + procedureSchema + "." + procedureNameFull ) ; procedureParams = new QueryParameters ( ) ; //procedureParameters = metaData.getProcedureColumns(null, procedureSchema, "%", "%"); //procedureParameters = metaData.getProcedureColumns(procedureCatalog, procedureSchema, "%" + procedureNameFull + "%", "%"); while ( procedureParameters . next ( ) == true ) { //procedureCatalog = procedureParameters.getString("PROCEDURE_CAT"); //procedureSchema = procedureParameters.getString("PROCEDURE_SCHEM"); //procedureNameFull = procedureParameters.getString("PROCEDURE_NAME"); //System.out.println(procedureCatalog + "." + procedureSchema + "." + procedureNameFull); procedureParameterName = procedureParameters . getString ( "COLUMN_NAME" ) ; procedureParameterDirection = procedureParameters . getInt ( "COLUMN_TYPE" ) ; procedureParameterType = procedureParameters . getInt ( "DATA_TYPE" ) ; if ( procedureParameterName == null && ( procedureParameterDirection == DatabaseMetaData . procedureColumnIn || procedureParameterDirection == DatabaseMetaData . procedureColumnInOut || procedureParameterDirection == DatabaseMetaData . procedureColumnOut ) ) { // according to Spring - it is probably a member of a collection } else { direction = convertToDirection ( procedureParameterDirection ) ; procedureParams . set ( procedureParameterName , null , procedureParameterType , direction , procedureParams . orderSize ( ) ) ; } } MjdbcUtils . closeQuietly ( procedureParameters ) ; this . procedureParameters . put ( procedurePath , procedureParams ) ; } MjdbcUtils . closeQuietly ( procedures ) ; return proceduresList . size ( ) ; }
Function which is responsible for retrieving Stored Procedure parameters and storage it into cache . This function doesn t perform cache read - only cache update .