code: protected QueryInputHandler convertToQueryInputHandler(AbstractNamedInputHandler inputHandler, String catalog, String schema, boolean useCache) throws SQLException {
          QueryInputHandler result = null;
  
          String shortProcedureName = CallableUtils.getStoredProcedureShortNameFromSql(inputHandler.getEncodedQueryString());
          boolean expectedReturn = CallableUtils.isFunctionCall(inputHandler.getEncodedQueryString());
  
          Connection conn = this.transactionHandler.getConnection();
  
          try {
  
              //QueryParameters procedureParams = SimpleMetaDataFactory.getProcedureParameters(conn, catalog, schema, shortProcedureName, useCache);
              QueryParameters procedureParams = this.metadataHandler.getProcedureParameters(conn, catalog, schema, shortProcedureName, useCache);
  
              QueryParameters inputParams = inputHandler.getQueryParameters();
              String encodedSql = inputHandler.getEncodedQueryString();
  
              // trying to detect if user omitted return, but database returned it.
              if (expectedReturn == false && (procedureParams.orderSize() == inputParams.orderSize() + 1)) {
                  for (String parameterName : procedureParams.keySet()) {
                      if (procedureParams.getDirection(parameterName) == QueryParameters.Direction.RETURN) {
                          procedureParams.remove(parameterName);
                          break;
                      }
                  }
              }
  
              if (procedureParams.orderSize() != inputParams.orderSize()) {
                  throw new MjdbcSQLException(String.format("Database reported %d parameters, but only %d were supplied.", procedureParams.orderSize(), inputParams.orderSize()));
              }
  
              inputParams = CallableUtils.updateDirections(inputParams, procedureParams);
              inputParams = CallableUtils.updateTypes(inputParams, procedureParams);
  
              result = new QueryInputHandler(encodedSql, inputParams);
          } finally {
              this.transactionHandler.closeConnection();
          }
  
          return result;
      }
docs: Uses {@link MetadataHandler} to read Stored Procedure/Function parameters and creates new
  {@link QueryInputHandler} instance with parameter values from @inputHandler
  
  @param inputHandler {@link AbstractNamedInputHandler} which used as source for {@link QueryInputHandler}
  parameter values
  @param catalog      Database Catalog
  @param schema       Database Schema
  @param useCache     specifies if {@link MetadataHandler} should use cache
  @return new filled {@link QueryInputHandler} instance with values from @inputHandler
  @throws SQLException if exception would be thrown by Driver/Database