preparedStatement With Large Values Causes "java.sql.SQLException: Data size bigger than max size for this type" (Doc ID 214868.1)

Last updated on AUGUST 16, 2016

Applies to:

JDBC - Version: 9.0.1.0.0 to 10.1.0.5.0
This problem can occur on any platform.

Symptoms

When using a preparedStatement with method setObject, setString and so on and using large values, following error can occur:
java.sql.SQLException: Data size bigger than max size for this type: 4018


Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms