I don't know if anyone has come across this before but, when using JDBC, if I specify setMaxRows on the PreparedStatement, no rows are returned. As soon as I remove this statement, I get all the results.
This only seems to occur on tables which contain a column of type LONGVARCHAR and only when the LONGVARCHAR column is returned in the ResultSet. On tables without LONGVARCHAR columns I can use setMaxSize without any issues.
Another problem that I am encountering with the same tables is that, if I remove the setMaxRows statement and begin processing the ResultSet, when I get to the LONGVARCHAR column, I am unable to read the value. Instead, I get the following error:
Exception in thread "main" java.sql.SQLException: [Relativity JDBC Driver][SimbaLNA][Liant][Relativity RM Server]Invalid column number.
at relativity.jdbc.PackBuffer.getSQLException(Unknown Source)
at relativity.jdbc.RPCInterface.handleError(Unknown Source)
at relativity.jdbc.RPCInterface.SQLGetMoreLongDataSP(Unknown Source)
at relativity.jdbc.RPCInterface.SQLGetLongDataSP(Unknown Source)
at relativity.jdbc.DataSet.getLongData(Unknown Source)
at relativity.jdbc.DataSet.getValue(Unknown Source)
at relativity.jdbc.RelativityResultSet.getString(Unknown Source)
at pjbs.Test.main(Test.java:33)
It gives the same error whether I read it as a string or use getAsciiStream or getBinaryStream. If I try to use a getUnicodeStream it tells me that Unicode is not supported and if I use getCharacterStream it tells me that the method is not supported. I can't see any other methods in the ResultSet documentation that would give me this column value.
I can view the column metadata without any problems. I just can't read the value.
Any ideas how I can get the contents of the column? And how I can limit the number of rows returned?