Products Resources Support About Us

JDBC Driver Issues with Universe Configuration

universe

#1

There is a couple of important parameters for SQL queries that are :
MAXFETCHBUFF and MAXFETCHCOLS.

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.
at com.rs.u2.jdbc.UniJDBCMsgFactory.createException(UniJDBCMsgFactory.java:101)
at com.rs.u2.jdbc.UniJDBCExceptionSupport.addException(UniJDBCExceptionSupport.java:87)
at com.rs.u2.jdbc.UniJDBCProtocolU2Impl.addServerError(UniJDBCProtocolU2Impl.java:2844)
at com.rs.u2.jdbc.UniJDBCProtocolU2Impl.serverFetch(UniJDBCProtocolU2Impl.java:2432)

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 :
private static final String[] UNIVERSEopts = new String[]{“MAXFETCHBUFF =8192”, “MAXFETCHCOLS =400”, “DATEFORM =D-YMD[4,2,2]”, “EODCODE =930115”, “PRECISION =YES”, “SCALE =YES”, “NULLABLE =YES”, “DSPSIZE =YES”, “UNSIGNED =YES”, “MONEY =YES”, “UPDATE =YES”, “AUTOINC =NO”, “CASE =YES”, “SEARCH =YES”, “TXBEHAVIOR =1”, “TYPENAME =YES”};

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.


#2

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


#3

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 ??

image


#4

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:

https://my.rocketsoftware.com/RocketCommunity/articles/Tech_Note/JDBC-error-Row-length-exceeds-buffer-size-1478610416819