@Override protected void writeBlobToParameter(String name, Blob blob) throws SQLException { OutputStream out = (OutputStream) params.get(name); if (out == null) { return; } try (InputStream in = blob.getBinaryStream()) { ByteStreams.copy(in, out); } catch (IOException e) { throw new SQLException(e); } }
/** * Provides the value associated with the given key as {@link Value} * * @param key the key for which the value should ne returned * @return a value wrapping the internally associated value for the given key */ @Nonnull public Value getValue(Object key) { return Value.of(get(key)); }
private Object computeEffectiveParameterValue(String fullParameterName) throws SQLException { String accessPath = null; String parameterName = fullParameterName; if (fullParameterName.contains(".")) { accessPath = parameterName.substring(parameterName.indexOf('.') + 1); parameterName = parameterName.substring(0, parameterName.indexOf('.')); } Object paramValue = context.get(parameterName); if (accessPath == null || paramValue == null) { return paramValue; } try { return Reflection.evalAccessPath(accessPath, paramValue); } catch (Exception e) { throw new SQLException(NLS.fmtr("StatementCompiler.cannotEvalAccessPath") .set("name", parameterName) .set("path", accessPath) .set("value", paramValue) .set("query", originalSQL) .format(), e); } }