/** * PUBLIC: * Used to help bean introspection. */ public boolean getUsesStringBinding() { return getPlatform().usesStringBinding(); }
/** * PUBLIC: * TopLink can be configured to bind large strings. */ public boolean shouldUseStringBinding() { return getPlatform().usesStringBinding(); }
/** * Set a complex parameter. * @return true if parameter was successfully set by this method, false otherwise. */ private boolean setComplexParameterValue(final AbstractSession session, final PreparedStatement statement, final int index, final Object parameter) throws SQLException { if (parameter == null) { // no DatabaseField available statement.setNull(index, getJDBCType((Class)null)); } else if (parameter instanceof DatabaseField) { // Substituted null value for the corresponding DatabaseField. // Cannot bind null through set object, so we must compute to type. int jdbcType = getJDBCType((DatabaseField)parameter); statement.setNull(index, jdbcType); } else if ((parameter instanceof byte[]) && (usesStreamsForBinding())) { ByteArrayInputStream inputStream = new ByteArrayInputStream((byte[])parameter); statement.setBinaryStream(index, inputStream, ((byte[])parameter).length); } else if ((parameter instanceof String) && usesStringBinding() && (((String)parameter).length() > getStringBindingSize())) { CharArrayReader reader = new CharArrayReader(((String)parameter).toCharArray()); statement.setCharacterStream(index, reader, ((String)parameter).length()); } else if (parameter instanceof BindCallCustomParameter) { ((BindCallCustomParameter)(parameter)).set(this, statement, index, session); } else { return false; } return true; }
if (usesStringBinding() && (((String)dbValue).length() >= getStringBindingSize())) { databaseCall.bindParameter(writer, dbValue); nBoundParameters = 1;
/** * Copy the state into the new platform. */ public void copyInto(Platform platform) { super.copyInto(platform); if (!(platform instanceof DatabasePlatform)) { return; } DatabasePlatform databasePlatform = (DatabasePlatform)platform; databasePlatform.setShouldTrimStrings(shouldTrimStrings()); databasePlatform.setUsesNativeSQL(usesNativeSQL()); databasePlatform.setUsesByteArrayBinding(usesByteArrayBinding()); databasePlatform.setUsesStringBinding(usesStringBinding()); databasePlatform.setShouldBindAllParameters(shouldBindAllParameters()); databasePlatform.setShouldCacheAllStatements(shouldCacheAllStatements()); databasePlatform.setStatementCacheSize(getStatementCacheSize()); databasePlatform.setTransactionIsolation(getTransactionIsolation()); databasePlatform.setShouldForceFieldNamesToUpperCase(shouldForceFieldNamesToUpperCase()); databasePlatform.setShouldOptimizeDataConversion(shouldOptimizeDataConversion()); databasePlatform.setStringBindingSize(getStringBindingSize()); databasePlatform.setUsesStreamsForBinding(usesStreamsForBinding()); }