Beispiel #1
0
  @Override
  public String getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
    byte[] bytes = blobTypeHandler.getNullableResult(rs, columnIndex);

    if (bytes == null) {
      return null;
    }

    try {
      return new String(bytes, CHARSET);
    } catch (UnsupportedEncodingException e) {
      return null;
    }
  }
Beispiel #2
0
  @Override
  public void setNonNullParameter(PreparedStatement ps, int i, String parameter, JdbcType jdbcType)
      throws SQLException {
    byte[] bytes = new byte[0];

    if (parameter != null) {
      try {
        bytes = parameter.getBytes(CHARSET);
      } catch (UnsupportedEncodingException e) {
        log.error(e.getMessage(), e);
        bytes = new byte[0];
      }
    }

    blobTypeHandler.setNonNullParameter(ps, i, bytes, jdbcType);
  }