ResultSet m_rs = src.sqlQuery("SELECT SEARCH_CONDITION FROM SYS.USER_CONSTRAINTS WHERE CONSTRAINT_TYPE='C'");
if(m_rs.next()) {
//System.out.println("column type:" + reader);
//下面一行是出错地方:
java.io.Reader reader = (java.io.Reader)rs.getCharacterStream(columnName);
//value = (String)getLargerString(reader);
java.io.BufferedReader bufReader = new java.io.BufferedReader(reader);
StringBuffer strBuf = new StringBuffer();
String line;
while ((line = bufReader.readLine()) != null) {
strBuf.append(line);
strBuf.append("\r\n");
}
bufReader.close();
System.out.println("The content is:" + strBuf.toString());
//System.out.println("The content is:" + value);
}
2. 具体错误信息如下:
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:161)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:226)
at oracle.jdbc.driver.LongAccessor.getCharacterStream(LongAccessor.java:345)
at oracle.jdbc.driver.OracleResultSetImpl.getCharacterStream(OracleResultSetImpl.java:1457)
at oracle.jdbc.driver.OracleResultSet.getCharacterStream(OracleResultSet.java:2048)
3. 说明一下,之前是直接getLong(columnName)来取的, 同样出现流已被关闭的错误,上面的是查看网上流行的做法,但还是出现"流已被关闭",所以没法子了,急求高手帮忙阿.
3 个解决方案
#1
这个问题我自己已经解决了.
java.io.Reader reader = (java.io.Reader )m_rs.getCharacterStream(columnName);
java.io.Reader reader = (java.io.Reader )m_rs.getCharacterStream(columnName);
#2
怎么解决的?????、
#3
怎么解决的啊?
#1
这个问题我自己已经解决了.
java.io.Reader reader = (java.io.Reader )m_rs.getCharacterStream(columnName);
java.io.Reader reader = (java.io.Reader )m_rs.getCharacterStream(columnName);
#2
怎么解决的?????、
#3
怎么解决的啊?