gpt4 book ai didi

java - Hibernate自定义类型避免 'Caused by: java.sql.SQLException: Stream has already been closed'

转载 作者:搜寻专家 更新时间:2023-10-30 21:25:52 26 4
gpt4 key购买 nike

如何编写自定义 Long 类来处理 Oracle 中的 long 值,以避免出现以下错误?

Caused by: java.sql.SQLException: Stream has already been closed.

谢谢

最佳答案

甲骨文 recommends not using LongLong Raw 列(自 Oracle 8i 起)。它们仅出于遗留原因包含在 Oracle 中。如果您真的需要使用它们,您应该先处理这些列,然后再尝试接触 ResultSet 中的任何其他列:

Docs :

When a query selects one or more LONG or LONG RAW columns, the JDBC driver transfers these columns to the client in streaming mode. After a call to executeQuery or next, the data of the LONG column is waiting to be read.

Do not create tables with LONG columns. Use large object (LOB) columns, CLOB, NCLOB, and BLOB, instead. LONG columns are supported only for backward compatibility. Oracle recommends that you convert existing LONG columns to LOB columns. LOB columns are subject to far fewer restrictions than LONG columns.

至于 hibernate - 请参阅此 question .

关于java - Hibernate自定义类型避免 'Caused by: java.sql.SQLException: Stream has already been closed',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10174951/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com