Class SqlCharacterValue

java.lang.Object
org.springframework.jdbc.core.support.SqlCharacterValue
All Implemented Interfaces:
SqlTypeValue

public class SqlCharacterValue extends Object implements SqlTypeValue
Object to represent a character-based parameter value for a SQL statement, e.g. a character stream for a CLOB/NCLOB or a LONGVARCHAR column.

Designed for use with JdbcTemplate as well as JdbcClient, to be passed in as a parameter value wrapping the target content value. Can be combined with SqlParameterValue for specifying a SQL type, e.g. new SqlParameterValue(Types.CLOB, new SqlCharacterValue(myContent)). With most database drivers, the type hint is not actually necessary.

Since:
6.1.4
Author:
Juergen Hoeller
See Also:
  • Constructor Details

    • SqlCharacterValue

      public SqlCharacterValue(CharSequence string)
      Create a new CLOB value with the given content string.
      Parameters:
      string - the content as a String or other CharSequence
    • SqlCharacterValue

      public SqlCharacterValue(char[] characters)
      Create a new SqlCharacterValue for the given content.
      Parameters:
      characters - the content as a character array
    • SqlCharacterValue

      public SqlCharacterValue(Reader reader, long length)
      Create a new SqlCharacterValue for the given content.
      Parameters:
      reader - the content reader
      length - the length of the content
    • SqlCharacterValue

      public SqlCharacterValue(InputStream asciiStream, long length)
      Create a new SqlCharacterValue for the given content.
      Parameters:
      asciiStream - the content as ASCII stream
      length - the length of the content
  • Method Details