code: private String createQueryString() {
          QueryChunk[] chunks = query.getChunks();
  		if ((chunks == null) || (chunks.length == 0)) {
  			// no query chunks
  			return "";
  		}
  
  		StringBuffer sb = new StringBuffer();
          QueryChunk chunk = null;
          int position = 1;
          for (int i = 0; i < chunks.length; i++) {
  			chunk = chunks[i];
  			//System.out.println("chunk = " + chunk);
  			switch (chunk.getType()) {
  				case QueryChunk.PARAMETER_TYPE: {
                      position++;
                      String paramName = chunk.getText();
  					QueryParameter param = parameters.get(paramName);					
  					if (QueryParameter.MULTIPLE_SELECTION.equals(param.getSelection())) {
  						if (QueryUtil.isProcedureCall(query.getText())) {		
  							sb.append("?");
  						} else {
  							Object[] paramValue = (Object[]) parameterValues.get(paramName);						
  							sb.append('(');
  							for (int j = 0; j < paramValue.length; j++) {
  								if (j > 0) {
  									sb.append(',');
  								}
  								sb.append('?');
  							}
  							sb.append(')');
  						}
  					} else {
  						sb.append("?");
  					}
  					break;
  				}
  				case QueryChunk.TEXT_TYPE:
                      if (chunk.getText().contains("?")) {
                          outputParameterPosition = position;                        
                      }
                  default: {
  					sb.append(chunk.getText());
  					break;
  				}
  			}
  		}        
          return sb.toString();
  	}
docs: Parse query and return a string query  that will be passed to prepared
  statement(substitute parameter with '?' char).