Products Resources Support About Us

JDBC Driver Issues with Universe Configuration

There is a couple of important parameters for SQL queries that are :

The documentation says :

The actual number of characters in a UniVerse character column can be greater than its precision.
JDBC retrieves such extra characters, up to a limit. The number of bytes of character data that JDBC
retrieves from a character column is the smallest of:
:black_small_square: The number of bytes of data the column actually contains.
:black_small_square: The number of bytes of data that UCI can fetch. This is controlled by the UCI configuration
parameters MAXFETCHBUFF and MAXFETCHCOLS, defined in the uci.config file.
If your fetch buffer is not large enough to hold all the character data that the JDBC application
retrieves, it generates a truncation warning

Well, it does not triggers a warning but triggers an exception, that eventually, causes a rollback .

java.sql.SQLException: UniVerse/SQL: Row length exceeds buffer size.

Also, I am unable to find where to chage the value:

  1. There is no uci.config ?¿?¿?¿ of the JDBC Driver
  2. looking at the JDBC driver , all I find is a default init :

UniJDBCProperties getProperties() that loads static default values :

I see no place where to override those values, nor any reference on loading any uci.config file on the driver.

am I being stupid ???
I know this get solved on the uvodbc.config for ODBC at server side.

I can see how this gets confusing. Since you are using JDBC, you can put the setting on the URL connection string:

If the parameter MAXFETCHBUFF size is added to the url, then the problem should be solved.

i.e. String url = “jdbc:ibm-u2://localhost/HS.SALES?MAXFETCHBUFF=20000”;

Note there is a TechNote on the Customer Portal that goes into a bit more detail. If you do not have access to the portal, please contact your support provider.

Mike Rajkowski

1 Like

Hello Mike.
I was hoping for something like this.
I do have access to the portal.
Do you care sharing the URL to the tech note ???
Thanks a lot.

Also, is there also similiar to prefetch size and thresold for JDBC ??


Sorry I did not see this sooner searching the technotes for MAXFETCHBUFF will return several, bit the following is the one I believe will help most: