java.sql.Clob.free()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中java.sql.Clob.free()方法的一些代码示例,展示了Clob.free()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Clob.free()方法的具体详情如下:
包路径:java.sql.Clob
类名称:Clob
方法名:free

Clob.free介绍

[英]Frees any resources held by this clob. After free is called, calling method other than free will throw SQLException (calling freerepeatedly will do nothing).
[中]释放此clob持有的任何资源。调用free后,调用free以外的方法将抛出SQLException(重复调用free将不起任何作用)。

代码示例

代码示例来源:origin: alibaba/druid

public static void close(Clob x) {
  if (x == null) {
    return;
  }
  try {
    x.free();
  } catch (Exception e) {
    LOG.debug("close error", e);
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Override
public void close() {
  for (Blob blob : this.temporaryBlobs) {
    try {
      blob.free();
    }
    catch (SQLException ex) {
      logger.warn("Could not free BLOB", ex);
    }
  }
  for (Clob clob : this.temporaryClobs) {
    try {
      clob.free();
    }
    catch (SQLException ex) {
      logger.warn("Could not free CLOB", ex);
    }
  }
}

代码示例来源:origin: SonarSource/sonarqube

private static void doClobFree(Clob clob) throws SQLException {
 try {
  clob.free();
 } catch (AbstractMethodError e) {
  // JTS driver do not implement free() as it's using JDBC 3.0
 }
}

代码示例来源:origin: alibaba/druid

@Override
public void clob_free(ClobProxy clob) throws SQLException {
  if (this.pos < filterSize) {
    nextFilter().clob_free(this, clob);
    return;
  }
  clob.getRawClob().free();
}

代码示例来源:origin: stackoverflow.com

Clob clob = rs.getClob(i);
provider.defaultSerializeValue(clob.getCharacterStream(), jgen);
clob.free();
break;

代码示例来源:origin: hibernate/hibernate-orm

for ( Clob clob : clobs ) {
  try {
    clob.free();

代码示例来源:origin: apache/nifi

clob.free();
} else {
  rec.put(i - 1, null);

代码示例来源:origin: hibernate/hibernate-orm

@Test
public void testLobCreation() throws SQLException {
  Session session = sessionFactory().getCurrentSession();
  session.beginTransaction();
  Blob blob = Hibernate.getLobCreator( session ).createBlob( new byte[] {} );
  blob.free();
  Clob clob = Hibernate.getLobCreator( session ).createClob( "Steve" );
  clob.free();
  session.getTransaction().commit();
  assertFalse( session.isOpen() );
}

代码示例来源:origin: davidmoten/rxjava-jdbc

@Override
public void close() throws IOException {
  try {
    reader.close();
  } finally {
    try {
      clob.free();
    } catch (SQLException e) {
      log.debug(e.getMessage());
    }
  }
}

代码示例来源:origin: hibernate/hibernate-orm

clob.free();
nclob.free();

代码示例来源:origin: com.alibaba/druid

public static void close(Clob x) {
  if (x == null) {
    return;
  }
  try {
    x.free();
  } catch (Exception e) {
    LOG.debug("close error", e);
  }
}

代码示例来源:origin: davidmoten/rxjava-jdbc

/**
 * Returns the String of a {@link Clob} and frees the clob resource.
 * 
 * @param c
 * @return
 */
private static String toString(Clob c) {
  try {
    Reader reader = c.getCharacterStream();
    String result = IOUtils.toString(reader);
    reader.close();
    c.free();
    return result;
  } catch (IOException e) {
    throw new RuntimeException(e);
  } catch (SQLException e) {
    throw new SQLRuntimeException(e);
  }
}

代码示例来源:origin: ahmetaa/zemberek-nlp

private CorpusDocument getDocumentFromResultSet(ResultSet rs) throws Exception {
 CorpusDocument doc;
 int key = rs.getInt(1);
 String dId = rs.getString(2);
 String sId = rs.getString(3);
 Timestamp sourceDate = rs.getTimestamp(4);
 Timestamp processDate = rs.getTimestamp(5);
 Clob clob = rs.getClob(6);
 String content = readClob(clob);
 clob.free();
 doc = new CorpusDocument(
   dId,
   sId,
   content,
   sourceDate == null ? null : sourceDate.toLocalDateTime(),
   processDate == null ? null : processDate.toLocalDateTime()
 );
 doc.setKey(key);
 return doc;
}

代码示例来源:origin: aaberg/sql2o

clobVal.free();
} catch (Throwable ignore) {

代码示例来源:origin: com.alibaba/druid

@Override
public void clob_free(ClobProxy clob) throws SQLException {
  if (this.pos < filterSize) {
    nextFilter().clob_free(this, clob);
    return;
  }
  clob.getRawClob().free();
}

代码示例来源:origin: b3log/latke

} finally {
  try {
    clob.free();
  } catch (final Exception e) { // Some drivers dose not implement free(), for example, jtds
    LOGGER.log(Level.ERROR, "clob.free error", e);

代码示例来源:origin: co.paralleluniverse/comsat-jdbc

@Override
  public Void call() throws SQLException {
    clob.free();
    return null;
  }
});

代码示例来源:origin: xiaour/spring.boot.sapi.starter

public static void close(Clob x) {
  if (x == null) {
    return;
  }
  try {
    x.free();
  } catch (Exception e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: davidmoten/rxjava2-jdbc

@Override
public void close() throws IOException {
  try {
    reader.close();
  } finally {
    try {
      clob.free();
    } catch (SQLException e) {
      log.debug(e.getMessage());
    }
  }
}

代码示例来源:origin: stackoverflow.com

Array return_objs = ocs.getArray(1);

Clob[] clobs = (Clob[]) return_objs.getArray();

return_objs.free();

for(int i = 0; i < clobs.length; i++ )
{
  //Utilize clob

  clobs[i].free();
}

相关文章