So I'm having a big issue with CLOBs and Oracle. Up until now, the database my company has been using for this one client has just been passed simple Strings through a PreparedStatement. This has been fine, because those Strings have all been less than 4,000 characters. We just discovered that limit exists. Not 100% sure why, believe it's something related to how CLOBs behave. Anyway, I have been assigned to go into the code and fix this.
So, at the moment, the PreparedStatement has its parameters assigned through a very simple process:
((PreparedStatement) stmt).setObject(fieldIndex++, fieldInfo.value);
This has worked well enough for now, but obviously not so much going forward.
Anyway, so my first thought was to try and use some of the PreparedStatement methods related to CLOBs. fieldInfo.value is a declared type of Object, with its actual type set dynamically. Up until now, it's been kept as a String, as I said, so I decided I would just change its type and then use one of the PreparedStatement methods to assign it.
I've tried the following value types & PreparedStatement methods:
if(fieldInfo.value instanceof InputStream){
((PreparedStatement) stmt).setBinaryStream(fieldIndex++, (InputStream) fieldInfo.value);
}
if(fieldInfo.value instanceof Reader){
((PreparedStatement) stmt).setCharacterStream(fieldIndex++, (Reader) fieldInfo.value);
}
if(fieldInfo.value instanceof Clob){
((PreparedStatement) stmt).setClob(fieldIndex++, (Clob) fieldInfo.value);
}
I'm obviously not calling all of those in a row, those are just examples of what I've tried separately.
Every one of those has the same result: AbstractMethodError. Upon researching that exception, I saw that the issue is most likely my JDBC driver. Except... as far as I can tell, I'm on the right one. I've tried this with ojdbc6 & ojdbc7, same error. I've scoured my classpath, and every directory in the project, for any indication that an older jar is hiding there, and I can't seem to find one.
Does anyone have any idea what could be happening?