JDBC Interfaces A-L

This chapter describes the JDBC interfaces, and the Teradata-specific classes, that are supported by the Teradata JDBC Driver.

Note:  The following sections contain tables of the methods implemented by the Teradata JDBC Driver, with an indication of the level of support for the method by the Teradata JDBC Driver and the Teradata Database. Each supported method is also described separately in detail.

Array Interface

Description

This section describes the Array interface methods. Beginning with Teradata Database 14.0 and Teradata JDBC Driver 14.00.00.04, the java.sql.Array interface and the SQL ARRAY data type are supported. A Teradata SQL ARRAY is defined with one or more dimensions, and is used to store many values of the same data type sequentially or in a matrix-like format.

Methods

Supported

getArray()

Yes

getArray(long index, int count)

Yes

getArray(long index, int count, Map map)

Yes

getArray(Map map)

Yes

getBaseType()

Yes

getBaseTypeName()

Yes

getResultSet()

Yes

getResultSet(long index, int count)

Yes

getResultSet(long index, int count, Map map)

Yes

getResultSet(Map map)

Yes

Methods

getArray( )

Function: Returns the Array value designated by this Array object in the form of an array in the Java programming language.

Characteristic

Description

Syntax

public Object getArray() throws SQLException

Return

An array in the Java programming language that contains the ordered elements of the SQL ARRAY value designated by this Array object.

Note:  This method is supported beginning with Teradata Database 14.0 and Teradata JDBC Driver 14.00.00.04.

This method uses the type map associated with the connection for customizations of the type mappings of Struct objects received from the Teradata Database. An Array object created by the Connection createArrayOf method is not subject to JDBC custom type mapping.

getArray(long index, int count)

Function: Retrieves a section of the SQL ARRAY value designated by this Array object, beginning with the specified index and containing up to count successive elements of the SQL array.

Characteristic

Description

Syntax

public Object getArray(long index, int count) throws SQLException

where the parameter:

  • index is the array index of the first element to retrieve;

    the first element is at index 1

  • count is the number of successive SQL array elements to retrieve

Return

An array containing up to count consecutive elements of the SQL array, beginning with element index.

Note:  This method is supported beginning with Teradata Database 14.0 and Teradata JDBC Driver 14.00.00.04, and may only be used with a one-dimensional ARRAY type.

This method uses the type map associated with the connection for customizations of the type mappings of Struct objects received from the Teradata Database. An Array object created by the Connection createArrayOf method is not subject to JDBC custom type mapping.

getArray(long index, int count, Map map)

Function: Retreives a section of the SQL ARRAY value designated by this Array object, beginning with the specified index and containing up to count successive elements of the SQL array.

Characteristic

Description

Syntax

public Object getArray(long index, int count, Map map) throws SQLException

where the parameter:

  • index is the array index of the first element to retrieve;

    the first element is at index 1

  • count is the number of successive SQL array elements to retrieve
  • map is a java.util.Map object that contains SQL type names and the classes in the Java programming language to which they are mapped

Return

An array containing up to count consecutive elements of the SQL ARRAY value designated by this Array object, beginning with element index.

Note:  This method is supported beginning with Teradata Database 14.0 and Teradata JDBC Driver 14.00.00.04, and may only be used with a one-dimensional ARRAY type.

This method uses the specified type map customizations unless the base type of the array does not match a user-defined type in map, in which case it uses the standard mapping. An Array object created by the Connection createArrayOf method is not subject to JDBC custom type mapping.

getArray(Map map)

Function: Retrieves the contents of the SQL ARRAY value designated by this Array object.

Characteristic

Description

Syntax

public Object getArray(Map map) throws SQLException

where the parameter:

  • map is a java.util.Map object that contains mappings of SQL type names to classes in the Java programming language

Return

An array in the Java programming language that contains the ordered elements of the SQL array designated by this object.

Note:  This method is supported beginning with Teradata Database 14.0 and Teradata JDBC Driver 14.00.00.04.

This method uses the specified type map customizations unless the base type of the array does not match a user-defined type in map, in which case it uses the standard mapping. An Array object created by the Connection createArrayOf method is not subject to JDBC custom type mapping.

getBaseType( )

Function: Retrieves the JDBC type of the elements in the array designated by this Array object.

Characteristic

Description

Syntax

public int getBaseType() throws SQLException

Return

A constant from the class java.sql.Types that is the type code for the elements in the array designated by this Array object.

Note:  This method is supported beginning with Teradata Database 14.0 and Teradata JDBC Driver 14.00.00.04.

getBaseTypeName( )

Function: Retrieves the SQL type name of the elements in the array designated by this Array object.

Characteristic

Description

Syntax

public String getBaseTypeName() throws SQLException

Return

a String that is the database-specific name for a built-in base type; or the fully-qualified SQL type name for a base type that is a UDT.

Note:  This method is supported beginning with Teradata Database 14.0 and Teradata JDBC Driver 14.00.00.04.

getResultSet( )

Function: Retrieves a result set that contains the elements of the SQL ARRAY value designated by this Array object.

Characteristic

Description

Syntax

public ResultSet getResultSet() throws SQLException

Return

a java.sql.ResultSet object containing one row for each of the elements in the array designated by this Array object, with the rows in ascending order based on the indices.

Note:  This method is supported beginning with Teradata Database 14.0 and Teradata JDBC Driver 14.00.00.04, and may only be used with a one-dimensional ARRAY type.

This method uses the type map associated with the connection for customizations of the type mappings of Struct objects received from the Teradata Database. An Array object created by the Connection createArrayOf method is not subject to JDBC custom type mapping.

getResultSet(long index, int count)

Function: Retrieves a result set holding the elements of the subarray that starts at index index and contains up to count successive elements.

Characteristic

Description

Syntax

public ResultSet getResultSet(long index, int count) throws SQLException

where the parameter:

  • index is the array index of the first element to retrieve;

    the first element is at index 1

  • count is the number of successive SQL array elements to retrieve

Return

A ResultSet object containing up to count consecutive elements of the SQL array designated by this Array object, starting at index index.

Note:  This method is supported beginning with Teradata Database 14.0 and Teradata JDBC Driver 14.00.00.04, and may only be used with a one-dimensional ARRAY type.

This method uses the type map associated with the connection for customizations of the type mappings of Struct objects received from the Teradata Database. An Array object created by the Connection createArrayOf method is not subject to JDBC custom type mapping.

getResultSet(long index, int count, Map map)

Function: Retrieves a result set holding the elements of the subarray that starts at index index and contains up to count successive elements.

Characteristic

Description

Syntax

public ResultSet getResultSet(long index, int count, Map map) throws SQLException

where the parameter:

  • index is the array index of the first element to retrieve;

    the first element is at index 1

  • count is the number of successive SQL array elements to retrieve
  • map is a java.util.Map object that contains SQL type names and the classes in the Java programming language to which they are mapped

Return

A ResultSet object containing up to count consecutive elements of the SQL array designated by this Array object, starting at index index.

Note:  This method is supported beginning with Teradata Database 14.0 and Teradata JDBC Driver 14.00.00.04, and may only be used with a one-dimensional ARRAY type.

This method uses the specified type map customizations unless the base type of the array does not match a user-defined type in map, in which case it uses the standard mapping. An Array object created by the Connection createArrayOf method is not subject to JDBC custom type mapping.

The result set contains one row for each array element, with two columns in each row. The second column stores the element value; the first column stores the index into the array for that element (with the first array element being at index 1). The rows are in ascending order corresponding to the order of the indices.

getResultSet(Map map)

Function: Retrieves a result set that contains the elements of the SQL ARRAY value designated by this Array object.

Characteristic

Description

Syntax

public ResultSet getResultSet(Map map) throws SQLException

where the parameter:

  • map is a java.util.Map object that contains mappings of SQL user-defined type names to classes in the Java programming language

Return

A ResultSet object containing one row for each of the elements in the array designated by this Array object, with the rows in ascending order based on the indices.

Note:  This method is supported beginning with Teradata Database 14.0 and Teradata JDBC Driver 14.00.00.04, and may only be used with a one-dimensional ARRAY type.

This method uses the specified type map customizations unless the base type of the array does not match a user-defined type in map, in which case it uses the standard mapping. An Array object created by the Connection createArrayOf method is not subject to JDBC custom type mapping.

The result set contains one row for each array element, with two columns in each row. The second column stores the element value; the first column stores the index into the array for that element (with the first array element being at index 1). The rows are in ascending order corresponding to the order of the indices.

Blob Interface

Description

This section describes the BLOB interface methods. A BLOB is a large database object that can be anything not requiring character-set conversion, including MIDI, MP3, PDF, and graphics.

Methods

Supported

free()

Yes

getBinaryStream()

Yes

getBytes(long pos, int length)

Yes

length()

Yes

position(Blob pattern, long start)

No

position(byte[] pattern, long start)

No

setBinaryStream(long pos)

Yes

setBytes(long pos, byte[] bytes)

Yes

setBytes(long pos, byte[] bytes, int offset, int len)

Yes

truncate(long len)

Yes

Methods

free( )

Function: Releases the resources held by this Blob object. After free has been called, the Blob object cannot be used.

The free method is available beginning with Teradata JDBC Driver 14.00.00.08. If the application updates a Blob object, then the application must call free when the application is done with the Blob object; otherwise, Teradata Database Error 3130 (Response Limit Exceeded) may occur.

With JDK 6.0 and later, the free method is defined in the java.sql.Blob interface, and the free method can be called directly by the application. With JDK 5.0 and earlier, reflection must be used to call the free method.

Characteristic

Description

Syntax

public void free() throws SQLException

getBinaryStream( )

Function: Materializes the BLOB value designated by this BLOB object as a stream of uninterpreted bytes.

Characteristic

Description

Syntax

public InputStream getBinaryStream() throws SQLException

Return

A stream containing the BLOB data is returned.

getBytes(long pos, integer length)

Function: Materializes the BLOB value designated by this BLOB object as an array of bytes.

Characteristic

Description

Syntax

public byte[] getBytes(long pos, integer length) throws SQLException

where

  • pos is the ordinal position of the first byte in the BLOB value that is extracted.

    The first byte is position 1.

  • length is the number of consecutive bytes that is copied

Return

A byte array of size length containing consecutive bytes from the BLOB value is returned.

length( )

Function: Returns the number of bytes in the BLOB value that the BLOB object designates.

Characteristic

Description

Syntax

public long length() throws SQLException

Return

The length of the BLOB in bytes is returned.

setBinaryStream(long pos)

Function: Retrieves a stream that can be used to write the BLOB value that this BLOB object represents. The stream begins at position pos.

Characteristic

Description

Syntax

public OutputStream setBinaryStream(long pos) throws SQLException

where the parameter pos is the position in the BLOB value at which to start writing

Return

A java.io.OutputStream object to which data can be written is returned.

setBytes(long pos, byte[ ] bytes)

Function: Writes the given array of bytes to the BLOB value that this BLOB object represents, starting at position pos, and returns the number of bytes written.

Characteristic

Description

Syntax

public int setBytes(long pos, byte[] bytes) throws SQLException

where the parameter:

  • pos is the position in the BLOB object at which to start writing
  • bytes is the array of bytes to be written to the BLOB value that this BLOB object represents

Return

The number of bytes written is returned.

 

Note:  The maximum length of bytes that can be set is 64000.

setBytes(long pos, byte[ ] bytes, int offset, int len)

Function: Writes all or part of a given byte array to the BLOB value that this BLOB object represents and returns the number of bytes written. Writing starts at position pos in the BLOB value; len bytes from the given byte array are written.

Characteristic

Description

Syntax

public int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException

where the parameter:

  • pos is the position in the BLOB object at which to start writing
  • bytes is the array of bytes to be written to this BLOB object
  • offset is the offset into the array bytes at which to start reading the bytes to be set
  • len is the number of bytes to be written to the BLOB value from the array of bytes

Return

The number of bytes written is returned.

 

Note:  The maximum length of bytes that can be set is 64000.

truncate(long len)

Function: Truncates the BLOB value that this BLOB object represents to be len bytes in length.

Characteristic

Description

Syntax

public void truncate(long len) throws SQLException

where the parameter len is the length, in bytes, to truncate the BLOB value that this BLOB object represents

Clob Interface

Description

This section describes the CLOB interface methods. A CLOB is a pure character-based large object in a database. It can be a large text file, HTML, RTF, or other character-based file.

Methods

Supported

free()

Yes

getAsciiStream()

Yes

getCharacterStream()

Yes

getSubString(long pos, int length)

Yes

length()

Yes

position(Clob searchstr, long start)

No

position(String searchstr, long start)

No

setAsciiStream(long pos)

Yes

setCharacterStream(long pos)

Yes

setString(long pos, String str)

Yes

setString(long pos, String str, int offset, int len)

Yes

truncate(long len)

Yes

Methods

free( )

Function: Releases the resources held by this Clob object. After free has been called, the Clob object cannot be used.

The free method is available beginning with Teradata JDBC Driver 14.00.00.08. If the application updates a Clob object, then the application must call free when the application is done with the Clob object; otherwise, Teradata Database Error 3130 (Response Limit Exceeded) may occur.

With JDK 6.0 and later, the free method is defined in the java.sql.Clob interface, and the free method can be called directly by the application. With JDK 5.0 and earlier, reflection must be used to call the free method.

Characteristic

Description

Syntax

public void free() throws SQLException

getAsciiStream( )

Function: Gets the CLOB value designated by this CLOB object as a stream of ASCII characters.

Characteristic

Description

Syntax

public InputStream getAsciiStream() throws SQLException

Return

A java.io.InputStream object containing the data in the CLOB is returned.

getCharacterStream( )

Function: Gets the CLOB value designated by this CLOB object as a Unicode stream.

Characteristic

Description

Syntax

public Reader getCharacterStream() throws SQLException

Return

A java.io.Reader object containing the data in the CLOB is returned.

getSubString(long pos, int length)

Function: Returns a copy of the specified substring in the CLOB value designated by this CLOB object.

Characteristic

Description

Syntax

public String getSubString(long pos, int length) throws SQLException

where the parameter:

  • pos is the first character of the substring to be extracted.

    The first character is located at position 1.

  • length is the number of consecutive characters copied

Return

The specified substring in the CLOB as a String is returned.

length()

Function: Returns the number of bytes in the CLOB value designated by this CLOB object.

Characteristic

Description

Syntax

public long length() throws SQLException

Return

The length of the CLOB is returned.

setAsciiStream(long pos)

Function: Retrieves a stream to be used to write ASCII characters to the CLOB value that this CLOB object represents, starting at position pos.

Characteristic

Description

Syntax

public OutputStream setAsciiStream(long pos) throws SQLException

where the parameter pos is the position at which to start writing to this CLOB object

Return

The stream to which ASCII-encoded characters can be written is returned.

setCharacterStream(long pos)

Function: Retrieves a stream to be used to write a stream of Unicode characters to the CLOB value that this CLOB object represents, at position pos.

Characteristic

Description

Syntax

public Writer setCharacterStream(long pos) throws SQLException

where the parameter pos is the position at which to start writing to the CLOB value

Return

A stream to which Unicode-encoded characters can be written is returned.

setString(long pos, String str)

Function: Writes the given Java string to the CLOB value that this CLOB object designates at position pos.

Characteristic

Description

Syntax

public int setString(long pos, String str) throws SQLException

where the parameter:

  • pos is the position at which to start writing to the CLOB value that this CLOB object represents
  • str is the string to be written to the CLOB value that this CLOB designates

Return

The number of characters written is returned.

Note:  The maximum number of bytes that can be set is 64000.

setString(long pos, String str, int offset, int len)

Function: Writes len characters of str, starting at character offset, to the CLOB value that this CLOB represents.

Characteristic

Description

Syntax

public int setString(long pos, String str, int offset, int len) throws SQLException

where the parameter:

  • pos is the position at which to start writing to this CLOB object
  • str is the string to be written to the CLOB value that this CLOB object represents
  • offset is the offset into str to start reading the characters to be written
  • len is the number of characters to be written

Return

The number of characters written is returned.

Note:  The maximum number of bytes that can be set is 64000.

truncate(long len)

Function: Truncates the CLOB value that this CLOB designates to have a length of len characters.

Characteristic

Description

Syntax

public void truncate(long len) throws SQLException

where the parameter len is the length, in bytes, to which the CLOB value truncates

CallableStatement Interface

Description

A CallableStatement is an object that represents a prepared SQL statement. A CallableStatement is primarily intended to CALL a stored procedure; however, CallableStatements can be used for other kinds of SQL requests.

Starting with Teradata JDBC Driver Release 03.01.00, a Teradata Database macro must be executed using a Statement or PreparedStatement. Previous releases of the Teradata JDBC Driver returned an erroneous result set when the CallableStatement execute or executeQuery method was used to execute a Teradata Database macro.

Methods

Supported

getArray(int parameterIndex)

Yes

getBigDecimal(int parameterIndex)

Yes

getBigDecimal(int parameterIndex, int scale) [DEPRECATED]

Yes

getBlob(int i)

Yes

getBoolean(int parameterIndex)

Yes

getByte(int parameterIndex)

Yes

getBytes(int parameterIndex)

Yes

getClob(int i)

Yes

getDate(int parameterIndex)

Yes

getDate(int parameterIndex, Calendar cal)

Yes

getDouble(int parameterIndex)

Yes

getFloat(int parameterIndex)

Yes

getInt(int parameterIndex)

Yes

getLong(int parameterIndex)

Yes

getObject(int parameterIndex)

Yes

getObject(int i, Map map)

Yes

getRef(int i)

No

getShort(int parameterIndex)

Yes

getSQLXML(int parameterIndex)

Yes

getString(int parameterIndex)

Yes

getTime(int parameterIndex)

Yes

getTime(int parameterIndex, Calendar cal)

Yes

getTimestamp(int parameterIndex)

Yes

getTimestamp(int parameterIndex, Calendar cal)

Yes

registerOutParameter(int parameterIndex, int sqlType)

Yes

registerOutParameter(int parameterIndex, int sqlType, int scale)

Yes

registerOutParameter(int parameterIndex, int sqlType, String typeName)

Yes

wasNull()

Yes

Methods

getArray(int parameterIndex)

Function: Gets the value of the designated JDBC ARRAY parameter as an Array Object in the Java Programming language.

Characteristic

Description

Syntax

public Array getArray(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

The parameter value as an Array Object is returned. If the value is SQL NULL, the result is null.

Note:  This method is available beginning with Teradata Database 14.0 and Teradata JDBC Driver 14.00.00.04.

getBigDecimal(int parameterIndex)

Function: Gets the value of a JDBC NUMERIC parameter as a java.math.BigDecimal object with as many digits to the right of the decimal point as the value contains.

Characteristic

Description

Syntax

public BigDecimal getBigDecimal(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

The parameter value in full precision is returned. If the value is SQL NULL, the result is null.

getBigDecimal(int parameterIndex, int scale)

Function: [DEPRECATED] Gets the value of a JDBC NUMERIC parameter as a java.math.BigDecimal object with scale digits to the right of the decimal point.

Characteristic

Description

Syntax

public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException

where:

  • the first parameterIndex parameter is 1, the second is 2, and so on
  • scale is the number of digits to the right of the decimal point

Return

The parameter value in full precision is returned. If the value is SQL NULL, the result is null.

getBoolean(int parameterIndex)

Function: Gets the value of a JDBC BIT parameter as a boolean in the Java programming language.

Characteristic

Description

Syntax

public boolean getBoolean(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

The parameter value is returned. If the value is SQL NULL, the result is false.

getByte(int parameterIndex)

Function: Gets the value of a JDBC TINYINT parameter as a byte in the Java programming language.

Characteristic

Description

Syntax

public byte getByte(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

The parameter value is returned. If the value is SQL NULL, the result is 0.

getBytes(int parameterIndex)

Function: Gets the value of a JDBC BINARY or VARBINARY parameter as an array of byte values in the Java programming language.

Characteristic

Description

Syntax

public byte[] getBytes(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

The parameter value is returned. If the value is SQL NULL, the result is null.

getDate(int parameterIndex)

Function: Gets the value of a JDBC DATE parameter as a java.sql.Date object.

Characteristic

Description

Syntax

public Date getDate(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

The parameter value is returned. If the value is SQL NULL, the result is null.

Note:  Maps to ResultSet.getDate(); see this method for further information.

getDate(int parameterIndex, Calendar cal)

Function: Gets the value of a JDBC DATE parameter as a java.sql.Date object.

Characteristic

Description

Syntax

public Date getDate(int parameterIndex, Calendar cal) throws SQLException

where

  • the first parameterIndex parameter is 1, the second is 2, and so on
  • cal is the Calendar object the driver will use to construct the date

Return

The parameter value is returned. If the value is SQL NULL, the result is null.

Note:  Maps to ResultSet.getDate(); see this method for further information.

getDouble(int parameterIndex)

Function: Gets the value of a JDBC DOUBLE parameter as a double in the Java programming language.

Characteristic

Description

Syntax

public double getDouble(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

The parameter value is returned. If the value is SQL NULL, the result is 0.

getFloat(int parameterIndex)

Function: Gets the value of a JDBC FLOAT parameter as a float in the Java programming language.

Characteristic

Description

Syntax

public float getFloat(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

The parameter value is returned. If the value is SQL NULL, the result is 0.

getInt(int parameterIndex)

Function: Gets the value of a JDBC INTEGER parameter as an int in the Java programming language.

Characteristic

Description

Syntax

public int getInt(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

The parameter value is returned. If the value is SQL NULL, the result is 0.

getLobData( )

Function: Retrieves the Lob data from the input stream and returns it to the database.

Characteristic

Description

Syntax

public InputStream getLobData() throws SQLException

Return

The Lob data from the input stream to the database is returned.

getLong(int parameterIndex)

Function: Gets the value of a JDBC BIGINT parameter as a long in the Java programming language.

Characteristic

Description

Syntax

public int getLong(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

The parameter value is returned. If the value is SQL NULL, the result is 0.

getObject(int parameterIndex)

Function: Gets the value of a parameter as an object in the Java programming language.

Characteristic

Description

Syntax

public Object getObject(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

A java.lang.Object holding the OUT parameter value is returned.

Note:  This method returns a Java object whose type corresponds to the JDBC type that was registered for this parameter using the method registerOutParameter. By registering the target JDBC type as java.sql.Types.OTHER, this method can be used to read database-specific abstract data types.

getShort(int parameterIndex)

Function: Gets the value of a JDBC SMALLINT parameter as a short in the Java programming language.

Characteristic

Description

Syntax

public short getShort(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

The parameter value is returned. If the value is SQL NULL, the result is 0.

getSQLXML(int parameterIndex)

Function: Gets the value of the designated SQL XML parameter as a java.sql.SQLXML object.

Characteristic

Description

Syntax

public SQLXML getSQLXML(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

The parameter value is returned. If the value is SQL NULL, the result is null.

Note:  This method is supported beginning with Teradata Database 14.10 and Teradata JDBC Driver 14.00.00.19.

JDK 6.0 or later is required to use SQLXML functionality.

getString(int parameterIndex)

Function: Retrieves the value of a JDBC CHAR, VARCHAR, or LONGVARCHAR parameter as a String in the Java programming language.

Characteristic

Description

Syntax

public String getString(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

The parameter value is returned. If the value is SQL NULL, the result is null.

Note:  For the fixed-length type JDBC CHAR, the String object returned has exactly the same value the JDBC CHAR value had in the database, including any padding added by the database.

getTime(int parameterIndex)

Function: Gets the value of a JDBC TIME parameter as a java.sql.Time object.

Characteristic

Description

Syntax

public Time getTime(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Note:  Maps to ResultSet.getDate(); see this method for further information.

Return

The parameter value is returned. If the value is SQL NULL, the result is null.

Note:  Maps to ResultSet.getTime(); see this method for further information.

getTime(int parameterIndex, Calendar cal)

Function: Gets the value of a JDBC TIME parameter as a java.sql.Time object.

Characteristic

Description

Syntax

public Time getTime(int parameterIndex, Calendar cal) throws SQLException

where

  • the first parameterIndex parameter is 1, the second is 2, and so on
  • cal is the Calendar object the driver will use to construct the date

Note:  Maps to ResultSet.getDate(); see this method for further information.

Return

The parameter value is returned. If the value is SQL NULL, the result is null.

Note:  Maps to ResultSet.getTime(); see this method for further information.

getTimestamp(int parameterIndex)

Function: Gets the value of a JDBC TIMESTAMP parameter as a java.sql.Timestamp object.

Characteristic

Description

Syntax

public Timestamp getTimestamp(int parameterIndex) throws SQLException

where the first parameterIndex parameter is 1, the second is 2, and so on

Return

The parameter value is returned. If the value is SQL NULL, the result is null.

Note:  Maps to ResultSet.getTimestamp(); see this method for further information.

getTimestamp(int parameterIndex, Calendar cal)

Function: Gets the value of a JDBC TIMESTAMP parameter as a java.sql.Timestamp object.

Characteristic

Description

Syntax

public Timestamp getTimestamp(int parameterIndex, Calendar cal) throws SQLException

where

  • the first parameterIndex parameter is 1, the second is 2, and so on
  • cal is the Calendar object the driver will use to construct the date

Return

The parameter value is returned. If the value is SQL NULL, the result is null.

Note:  Maps to ResultSet.getTimestamp(); see this method for further information.

registerOutParameter(int parameterIndex, int sqlType)

Function: Registers the OUT parameter in ordinal position parameterIndex to the JDBC type sqlType.

Characteristic

Description

Syntax

public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException

where

  • the first parameterIndex parameter is 1, the second is 2, and so on
  • sqlType is the JDBC type code defined by java.sql.Types. If the parameter is of type Numeric or Decimal, the version of registerOutParameter that accepts a scale value should be used.

Note:  All OUT parameters must be registered before a stored procedure is executed.

The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that parameter.

If the JDBC type expected to be returned to this output parameter is specific to this particular database, sqlType should be java.sql.Types.OTHER. The method getObject(int) retrieves the value.

registerOutParameter(int parameterIndex, int sqlType, int scale)

Function: Registers the parameter in ordinal position parameterIndex to be of JDBC type sqlType.

Characteristic

Description

Syntax

public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException

where

  • the first parameterIndex parameter is 1, the second is 2, and so on
  • sqlType is the JDBC type code defined by java.sql.Types. If the parameter is of type Numeric or Decimal, the version of registerOutParameter that accepts a scale value should be used.
  • scale is the desired number of digits to the right of the decimal point. It must be greater than or equal to 0.

Note:  This method must be called before a stored procedure is executed.

The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that parameter.

This version of registerOutParameter should be used when the parameter is of JDBC type NUMERIC or DECIMAL.

registerOutParameter(int parameterIndex, int sqlType, String typename)

Function: Registers the designated output parameter.

Characteristic

Description

Syntax

public void registerOutParameter(int parameterIndex, int sqlType, String typename) throws SQLException

where

  • the first parameterIndex parameter is 1, the second is 2, and so on
  • sqlType is the JDBC type code defined by java.sql.Types. If the parameter is of type Numeric or Decimal, the version of registerOutParameter that accepts a scale value should be used.
  • typename is the fully qualified name of an SQL structured type.

Note:  The last parameter is ignored.

wasNull()

Function: Indicates whether or not the last OUT parameter read had the value of SQL NULL.

Characteristic

Description

Syntax

public boolean wasNull() throws SQLException

Return

True, if the last parameter read was SQL NULL

False, otherwise

Note:  This method should be called only after calling the get method; otherwise, there is no value to use in determining whether it is null or not.

Connection Interface

Description

A Connection represents a session with a specific database. Within the context of a Connection, SQL statements are executed and results are returned.

A Connection's database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, and so forth. This information is obtained with the getMetaData method.

Note:  By default, the Connection automatically commits changes after executing each statement. If auto-commit is disabled, an explicit commit must be done or database changes are not saved.

Methods

Supported

clearWarnings()

Yes

close()

Yes

commit()

Yes

createArrayOf(String typeName, Object[] elements)

Yes

createSQLXML()

Yes

createStatement()

Yes

createStatement(int resultSetType, int resultSetConcurrency)

Yes

createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)

Yes

createStruct(String typeName, Object[] attributes)

Yes

getAutoCommit()

Yes

getCatalog()

Yes*

getClientInfo()

Yes

getClientInfo(String name)

Yes

getHoldability()

Yes

getMetaData()

Yes

getTransactionIsolation()

Yes

getTypeMap()

Yes

getWarnings()

Yes

isClosed()

Yes

isReadOnly() (always returns False)

Yes*

nativeSQL(String sql)

Yes

prepareCall(String sql)

Yes

prepareCall(String sql, int resultSetType, int resultSetConcurrency)

Yes

prepareStatement(String sql)

Yes

prepareStatement(String sql, int autoGeneratedKeys)

Yes

prepareStatement(String sql, int[ ] columnIndexes)

Yes

prepareStatement(String sql, String[ ] columnNames)

Yes

prepareStatement(String sql, int resultSetType, int resultSetConcurrency)

Yes

prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)

Yes

rollback()

Yes

setAutoCommit(boolean autoCommit)

Yes

setCatalog(String catalog)

Yes*

setHoldability(int holdability)

Yes

setReadOnly(boolean readonly)

No

setTransactionIsolation(int level)

Yes

setTypeMap(Map map)

Yes

Methods

The following subsections provide a brief description of each supported Connection method.

clearWarnings()

Function: After this call, getWarnings returns null until a new warning is reported for this Connection.

Characteristic

Description

Syntax

public void clearWarnings() throws SQLException

close()

Function: In some cases, it is desirable to immediately release a Connection’s database and JDBC resources instead of waiting for them to be automatically released. The close method provides this immediate release.

Characteristic

Description

Syntax

public void close() throws SQLException

Note:  A Connection is automatically closed when it is garbage collected. Certain fatal errors also result in a closed Connection.

commit()

Function: Commit makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by the Connection.

Characteristic

Description

Syntax

public void commit() throws SQLException

Note:  This method is only to be used when auto-commit is disabled. See also setAutoCommit(boolean autoCommit).

createArrayOf(String typeName, Object[] elements)

Function: Creates an Array object populated with the given elements.

Characteristic

Description

Syntax

public Array createArrayOf(String typeName, Object[] elements) throws SQLException

where the parameter:

  • typeName is the SQL name of the type the elements of the array map to
  • elements is the elements that populate the returned object

Return

An Array whose elements map to the specified SQL type.

Note:  This method is available beginning with Teradata Database 14.0 and Teradata JDBC Driver 14.00.00.04.

createSQLXML()

Function: Constructs an object that implements the SQLXML interface. The object returned initially contains no data.

Characteristic

Description

Syntax

public SQLXML createSQLXML() throws SQLException

Return

An object that implements the SQLXML interface.

Note:  This method is supported beginning with Teradata Database 14.10 and Teradata JDBC Driver 14.00.00.19.

JDK 6.0 or later is required to use SQLXML functionality.

createStatement()

Function: Creates a Statement object for sending SQL statements to the database.

Characteristic

Description

Syntax

public Statement createStatement() throws SQLException

Return

A new statement object is returned.

Note:  SQL statements without parameters are normally executed using statement objects. If the same SQL statement is executed many times, it is more efficient to use a prepared statement.

createStatement(int resultSetType, int resultSetConcurrency)

Function: Creates a statement object for sending SQL statements to the database. This method is the same as the createStatement() method, except that it allows the resultSetType and resultSetConcurrencyType to be overwritten.

Characteristic

Description

Syntax

public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException

where the parameter:

  • resultSetType is a result set type
  • resultSetConcurrency is a concurrency type

Return

A new statement object is returned.

Note:  SQL statements without parameters are normally executed using statement objects. If the same SQL statement is executed many times, it is more efficient to use a prepared statement.

createStatement(int resultSetType, int resultSetConcurrency, resultSetHoldability)

Function: Creates a statement object for sending SQL statements to the database. This method is the same as the createStatement() method, except that it allows the resultSetType, resultSetConcurrency, and resultSetHoldability to be overridden.

Characteristic

Description

Syntax

public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException

where the parameter:

  • resultSetType is a result set type
  • resultSetConcurrency is a result set concurrency
  • resultSetHoldability is a result set holdability

Return

A new statement object is returned.

Note:  SQL statements without parameters are normally executed using Statement objects. If the same SQL statement is executed many times, it is more efficient to use a PreparedStatement.

createStruct(String typeName, Object[] attributes)

Function: Creates a Struct object populated with the given attributes.

Characteristic

Description

Syntax

public Struct createStruct(String typeName, Object[] attributes) throws SQLException

where the parameter:

  • typeName is the SQL type name of the SQL structured type that this Struct object maps to
  • attributes is the attributes that populate the returned object

Return

A Struct object that maps to the given SQL type and is populated wtih the given attributes.

Note:  This method is available beginning with Teradata Database 13.10 and Teradata JDBC Driver 13.10.00.12.

getAutoCommit()

Function: Gets the current auto-commit state.

Characteristic

Description

Syntax

public boolean getAutoCommit() throws SQLException

Return

Current state of auto-commit mode is returned.

getCatalog()

Function: Gets the current catalog name for the connection.

Characteristic

Description

Syntax

public String getCatalog() throws SQLException

Return

Catalog name for the connection or null is returned.

Note:  Since the database does not support catalogs, ““ is always returned.

Properties getClientInfo()

Function: Returns a Properties object containing the name and current value of each property currently set in the Connection query band.

Characteristic

Description

Syntax

public Properties getClientInfo() throws SQLException

Return

A Properties object that contains the name and value of each item in the Connection query band. This method returns an empty Properties object if no query band has been set. If the same query band name is active for multiple contexts, only one of the corresponding query band values will be returned. Transaction query band values take precedence over session query band values, which take precedence over profile query band values.

Note:  This method is supported beginning with Teradata Database 12.0 and Teradata JDBC Driver 14.00.00.33.

JDK 6.0 or later is required to use this method.

Profile query band values are supported beginning with Teradata Database 15.10 and Teradata JDBC Driver 15.00.00.23.

getClientInfo(String name)

Function: Returns the Connection query band value specified by name.

Characteristic

Description

Syntax

public String getClientInfo(String name) throws SQLException

where the parameter:

  • name is a Query Band name

Return

The query band value specified by name. This method returns null if the specified name has not been set in the query band. If the same query band name is active for multiple contexts, only one of the corresponding query band values will be returned. Transaction query band values take precedence over session query band values, which take precedence over profile query band values.

Note:  This method is supported beginning with Teradata Database 12.0 and Teradata JDBC Driver 14.00.00.33.

JDK 6.0 or later is required to use this method.

Profile query band values are supported beginning with Teradata Database 15.10 and Teradata JDBC Driver 15.00.00.23.

getHoldability()

Function: Gets the result set holdability of Statement objects subsequently created using this Connection object.

Characteristic

Description

Syntax

public int getHoldability() throws SQLException

Return

ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT

Note:   ResultSet.CLOSE_CURSORS_AT_COMMIT is supported beginning with Teradata JDBC Driver 14.00.00.28. Earlier versions of the Teradata JDBC Driver supported only ResultSet.HOLD_CURSORS_OVER_COMMIT.

getMetaData()

Function: A Connection’s database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, and so on. This information is made available through a DatabaseMetaData object.

Characteristic

Description

Syntax

public DatabaseMetaData getMetaData() throws SQLException

Return

A DatabaseMetaData object for this Connection is returned.

getTransactionIsolation()

Function: Retrieves this Connection object’s current transaction isolation level.

Characteristic

Description

Syntax

public int getTransactionIsolation() throws SQLException

Return

Returns the current transaction isolation level, which will be one of the following constants: Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, Connection.TRANSACTION_SERIALIZABLE, or Connection.TRANSACTION_NONE

getTypeMap()

Function: Retrieves the Map object associated with this Connection object. Unless the application has added an entry, the type map returned will be empty.

Characteristic

Description

Syntax

public Map<String,Class<?>> getTypeMap() throws SQLException

Return

Returns the java.util.Map object associated with this Connection object.

getWarnings()

Function: Returns the first warning reported by calls on this Connection.

Characteristic

Description

Syntax

public SQLWarning getWarnings() throws SQLException

Return

The first SQL warning or null is returned.

Note:  Subsequent warnings will be chained to this SQL warning.

isClosed()

Function: Tests to see if a Connection is closed.

Characteristic

Description

Syntax

public boolean isClosed() throws SQLException

Return

True, if the Connection is closed

False, if the Connection is still open

isReadOnly()

Function: Tests the connection to determine if it is in read-only mode.

Characteristic

Description

Syntax

public boolean isReadOnly() throws SQLException

Return

True, if the connection is read-only

False, if the connection is otherwise

Note:  isReadOnly always returns False.

Note:  isReadOnly always returns False.

nativeSQL(String sql)

Function: A driver may convert the JDBC SQL grammar into its system’s native SQL grammar before sending it. NativeSQL returns the native form of the statement.

Characteristic

Description

Syntax

public String nativeSQL(String sql) throws SQLException

where the sql parameter is an SQL statement that may contain one or more question-mark parameter placeholders

Return

The native form of this statement is returned.

prepareCall(String sql)

Function: Creates a CallableStatement object for calling database stored procedures.

Characteristic

Description

Syntax

public CallableStatement prepareCall(String sql) throws SQLException

where the sql parameter is an SQL statement that may contain one or more question-mark parameter placeholders

Typically this statement is a JDBC function call escape string.

Return

A new CallableStatement object containing the prepared SQL statement is returned.

Note:  The CallableStatement provides methods for setting up its IN and OUT parameters, and methods for executing the call to a stored procedure.

This method is optimized for handling stored procedure call statements. Some drivers may send the call statement to the database when the method prepareCall is done. Others may wait until the CallableStatement is executed. Though this has no direct effect on users, it does affect which method throws certain SQLExceptions.

ResultSets created using the returned CallableStatement have forward-only type and read-only concurrence, by default.

prepareCall(String sql, int resultSetType, int resultSetConcurrency)

Function: Creates a CallableStatement object for calling database stored procedures.

Characteristic

Description

Syntax

public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException

where the parameter:

  • sql is an SQL statement that may contain one or more question-mark parameter placeholders. Typically, this statement is a JDBC function call escape string.
  • resultSetType is a result set type
  • resultSetConcurrency is a concurrency type

Return

A new CallableStatement object containing the prepared SQL statement is returned.

Note:  The CallableStatement provides methods for setting up its IN and OUT parameters, and methods for executing the call to a stored procedure.

This method is optimized for handling stored procedure call statements. Some drivers may send the call statement to the database when the method prepareCall is done. Others may wait until the CallableStatement is executed. Though this has no direct effect on users, it does affect which method throws certain SQLExceptions.

ResultSets created using the returned CallableStatement have forward‑only type and read‑only concurrence, by default.

prepareCall(String sql, int resultSetType, int resultSetConcurrency, resultSetHoldability)

Function: Creates a CallableStatement object for calling database stored procedures.

Characteristic

Description

Syntax

public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException

where the parameter:

  • sql is a SQL statement that may contain one or more question-mark parameter placeholders. Typically, this statement is a JDBC procedure call escape string.
  • resultSetType is a result set type
  • resultSetConcurrency is a result set concurrency
  • resultSetHoldability is a result set holdability

Return

A new CallableStatement object containing the prepared SQL statement is returned.

Note:  The CallableStatement provides methods for setting up its IN and OUT parameters, and methods for executing the call to a stored procedure.

This method is optimized for handling stored procedure call statements. Some drivers may send the call statement to the database when the method prepareCall is done. Others may wait until the CallableStatement is executed. Though this has no direct effect on users, it does affect which method throws certain SQLExceptions.

ResultSets created using the returned CallableStatement have forward‑only type and read‑only concurrence, by default.

prepareStatement(String sql)

Function: Creates a PreparedStatement object for sending parameterized SQL statements to the database.

Characteristic

Description

Syntax

public PreparedStatement prepareStatement(String sql) throws SQLException

where the sql parameter is an SQL statement that may contain one or more question-mark IN parameter placeholders

Return

A new PreparedStatement object containing the prepared statement is returned.

Note:  An SQL statement with or without IN parameters can be prepared and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.

This method is optimized for handling parametric SQL statements that benefit from precompilation.

If the driver supports precompilation, the method prepareStatement will send the statement to the database for precompilation.

Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement is executed. Though this has no direct effect on users, it does affect which method throws certain SQLExceptions.

ResultSets created using the returned PreparedStatement have forward‑only type and read‑only concurrence, by default.

Connection.prepareStatement(String query) will send the query to the database for parsing. If there is an error with the query, an exception will be generated at this time (example: the table is not yet created).

For earlier releases, Connection.prepareStatement(String query) only stored the query instead of sending it to the database for parsing, so no JDBC Exception is generated (example: if the table had not yet been created).

prepareStatement(String sql, int[ ] columnIndexes)

Function: Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array. This array contains the indexes of the columns in the target table that contain the auto-generated keys to be made available. This array is ignored if the SQL statement is not an INSERT statement.

An SQL statement with or without IN parameters can be prepared and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.

This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation, the method prepareStatement will send the statement to the database for precompilation. Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is executed. This has no direct effect on users; however, it does affect which methods throw certain SQLExceptions.

Result sets created using the returned PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a concurrency level of CONCUR_READ_ONLY.

Characteristic

Description

Syntax

public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException

where the parameter:

  • sql is an SQL statement that may contain one or more question-mark IN parameter placeholders
  • columnIndexes is an array of column indexes indicating the columns that should be returned from the inserted row or rows

Return

A new PreparedStatement object, containing the prepared statement that is capable of returning the auto-generated keys designated by the given array of column indexes is returned.

prepareStatement(String sql, String[ ] columnNames)

Function: Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array. This array contains the names of the columns in the target table that contain the auto-generated keys to be returned. This array is ignored if the SQL statement is not an INSERT statement.

An SQL statement with or without IN parameters can be prepared and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.

This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation, the method prepareStatement will send the statement to the database for precompilation. Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is executed. This has no direct effect on users; however, it does affect which methods throw certain SQLExceptions.

Result sets created using the returned PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a concurrency level of CONCUR_READ_ONLY.

Characteristic

Description

Syntax

public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException

where the parameter:

  • sql is an SQL statement that may contain one or more question-mark IN parameter placeholders
  • columnNames is an array of column names indicating the columns that should be returned from the inserted row or rows

Return

A new PreparedStatement object, containing the prepared statement that is capable of returning the auto-generated keys designated by the given array of column names is returned.

prepareStatement(String sql, int autogeneratedKeys)

Function: Creates a default PreparedStatement object that has the capability to retrieve auto-generated keys. The given constant tells the driver whether it should make auto-generated keys available for retrieval. This parameter is ignored if the SQL statement is not an INSERT statement.

This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation, the method prepareStatement will send the statement to the database for precompilation. Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is executed. This has no direct effect on users; however, it does affect which methods throw certain SQLExceptions.

Result sets created using the returned PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a concurrency level of CONCUR_READ_ONLY.

Characteristic

Description

Syntax

public PreparedStatement prepareStatement(String sql, int autogeneratedKeys) throws SQLException

where the parameter:

  • sql is an SQL statement that may contain one or more question-mark IN parameter placeholders
  • autogeneratedKeys is a flag indicating whether auto-generated keys should be returned; one of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS

Return

A new PreparedStatement object, containing the prepared SQL statement that will have the capability of returning auto-generated keys is returned.

Note:  If a database access error occurs or the given parameter is not a Statement constant indicating whether auto-generated keys should be returned, throws and SQLException.

Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement is executed. Though this has no direct effect on users, it does affect which method throws certain SQLExceptions.

ResultSets created using the returned PreparedStatement have forward‑only type and read‑only concurrence, by default.

prepareStatement(String sql, int resultSetType, int resultSetConcurrency)

Function: Creates a PreparedStatement object for sending parameterized SQL statements to the database.

Characteristic

Description

Syntax

public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException

where the parameter:

  • sql is an SQL statement that may contain one or more question-mark IN parameter placeholders
  • resultSetType is a result set type
  • resultSetConcurrency is a concurrency type

Return

A new PreparedStatement object containing the prepared statement is returned.

Note:  An SQL statement with or without IN parameters can be prepared and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.

This method is optimized for handling parametric SQL statements that benefit from precompilation.

Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement is executed. Though this has no direct effect on users, it does affect which method throws certain SQLExceptions.

prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)

Function: Creates a PreparedStatement object for sending parameterized SQL statements to the database.

Characteristic

Description

Syntax

public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException

where the parameter:

  • sql is a SQL statement that may contain one or more question-mark IN parameter placeholders
  • resultSetType is a result set type
  • resultSetConcurrency is a result set concurrency
  • resultSetHoldability is a result set holdability

Return

A new PreparedStatement object containing the prepared statement is returned.

Note:  A SQL statement with or without IN parameters can be prepared and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.

This method is optimized for handling parametric SQL statements that benefit from precompilation.

Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement is executed. Though this has no direct effect on users, it does affect which method throws certain SQLExceptions.

rollback()

Function: Drops all changes made since the previous commit/rollback and releases any database locks currently held by the Connection.

Characteristic

Description

Syntax

public void rollback() throws SQLException

Note:  This method is only to be used when auto-commit is disabled.

See also setAutoCommit(boolean autoCommit).

setAutoCommit(boolean autoCommit)

Function: If a Connection is in auto-commit mode, then all its SQL statements are executed and committed as individual transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by either a commit() or rollback().

By default, new connections are in auto-commit mode.

Characteristic

Description

Syntax

public void setAutoCommit(boolean autoCommit) throws SQLException

where the autoCommit parameter is the enable/disable specification:

True enables auto-commit

False disables auto-commit

Note:  The commit occurs when the statement completes or the next execute occurs, whichever comes first.

In the case of statements returning a ResultSet, the statement completes when the last row of the ResultSet has been retrieved or the ResultSet has been closed.

In advanced cases, a single statement may return multiple results as well as output parameter values. Here the commit occurs when all results and output parameter values have been retrieved.

setCatalog(String catalog)

Function: If the driver supports catalogs, this method sets a catalog name. The name selects working space in the connection’s database. If catalogs are not supported, setCatalog is ignored.

Characteristic

Description

Syntax

public void setCatalog(String catalog) throws SQLException

where the catalog parameter is a catalog name

Note:  As per the standard, setCatalog is silently ignored.

setHoldability(int holdability)

Function: Specifies the result set holdability for Statement objects subsequently created using this Connection.

Characteristic

Description

Syntax

public void setHoldability(int holdability) throws SQLException

where the holdability parameter is one of the following ResultSet constants:

ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT

Note:   ResultSet.CLOSE_CURSORS_AT_COMMIT is supported beginning with Teradata JDBC Driver 14.00.00.28. Earlier versions of the Teradata JDBC Driver supported only ResultSet.HOLD_CURSORS_OVER_COMMIT.

Changing the result set holdability of the Connection does not change the result set holdability of existing Statement, PreparedStatement, and CallableStatement objects. Changing the result set holdability of the Connection only specifies the result set holdability for Statement, PreparedStatement, and CallableStatement objects subsequently created on that Connection using one of the Connection create/prepare methods without a holdability argument. When a Statement, PreparedStatement, or CallableStatement is created using a Connection create/prepare method having a holdability argument, then the method's holdability argument overrides the Connection's result set holdability.

When auto-commit is on for the Connection, CLOSE_CURSORS_AT_COMMIT applies to result sets of Statements other than the Statement being executed.

CLOSE_CURSORS_AT_COMMIT applies to query result sets, and also applies to generated-key result sets returned by the Statement.getGeneratedKeys method.

A multi-statement request (MSR) can return multiple result sets. When an auto-commit or an explicit commit occurs, the Teradata JDBC Driver closes all MSR result sets with CLOSE_CURSORS_AT_COMMIT holdability for which at least one row has been received from the Teradata Database. When the application subsequently calls the Statement.getMoreResults and Statement.getResultSet methods, it is possible for the Statement.getResultSet method to return a result set that is already closed. In contrast, an MSR result set will not be closed if none of its rows have been received yet from the Teradata Database.

setTransactionIsolation(int level)

Function: Attempts to change the transaction isolation level for this Connection object to the one given. The constants defined in the interface Connection are the possible transaction isolation levels.

Characteristic

Description

Syntax

public void setTransactionIsolation(int level) throws SQLException

where the level parameter is one of the following Connection constants:

Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, or Connection.TRANSACTION_SERIALIZABLE

Note:  Connection.TRANSACTION_NONE cannot be used because it specifies that transactions are not supported.

Note:  If the requested transaction isolation level is not supported, it will be mapped to a higher, more restrictive supported transaction isolation level. The DatabaseMetaData method supportsTransactionIsolationLevel may be used to determine whether or not the driver supports a given level.

setTypeMap(Map<String,Class<?>>map)

Function: Installs the given TypeMap object as the type map for this Connection object. The type map is used for the custom mapping of SQL structured types and distinct types.

Characteristic

Description

Syntax

public void setTypeMap(Map<String,Class<?>> map) throws SQLException

where the map parameter is the java.util.Map object to install as the replacement for this Connection object's default type map

ConnectionEventListener Interface

Description

A ConnectionEventListener is an object that registers to receive events generated by a PooledConnection.

The ConnectionEventListener interface is implemented by a connection pooling component. A connection pooling component is usually provided by a JDBC driver vendor, or another system software vendor.

A ConnectionEventListener is notified by a JDBC driver when an application is finished using its Connection object. This event occurs after the application calls close on its representation of the PooledConnection.

A ConnectionEventListener is also notified when a Connection error occurs due to the fact that the PooledConnection is unfit for future use–the server has crashed, for example.

The listener is notified by the JDBC driver just before the driver throws an SQLException to the application using the PooledConnection.

Methods

Supported

connectionClosed(ConnectionEvent event)

Yes

connectionErrorOccurred(ConnectionEvent event)

Yes

Methods

connectionClosed(ConnectionEvent event)

Function: Notifies the ConnectionEventListener when the application calls close() on its representation of the connection.

Characteristic

Description

Syntax

public void connectionClosed(ConnectionEvent event)

where the event parameter is an event object describing the source of the event

connectionErrorOccurred(ConnectionEvent event)

Function: Notifies the ConnectionEventListener when a fatal connection error occurs, just before an SQLException is thrown to the application.

Characteristic

Description

Syntax

public void connectionErrorOccurred(ConnectionEvent event)

where the event parameter is an event object describing the source of the event. It contains the SQLException that the driver throws.

ConnectionPoolDataSource Interface

Description

A ConnectionPoolDataSource object is a factory for PooledConnection objects. An object that implements this interface is typically registered with a Java Naming and Directory Interface (JNDI) service.

Methods

Supported

getLoginTimeout()

Yes

getLogWriter()

Yes

getMaxStatements()

Yes

getPooledConnection()

Yes

getPooledConnection(String username, String password)

Yes

setLoginTimeout(int seconds)

Yes

setLogWriter(PrintWriter out)

Yes

Methods

getLoginTimeout()

Function: Gets the maximum time, in seconds, that this connection pool data source object can wait while attempting to connect to a database.

A value of zero indicates that there is no timeout. When a DataSource object is created, the login timeout is initially zero.

Characteristic

Description

Syntax

public int getLoginTimeout() throws SQLException

Return

The DataSource login timeout value is returned.

getLogWriter()

Function: Gets the log writer for this connection pool data source object.

The log writer is a character output stream to which all logging and tracing messages for this data source object instance are printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. Messages printed to a data source specific log writer are not printed to the log writer associated with the java.sql.DriverManager class. When a DataSource object is created, the log writer is initially null; logging is disabled.

Characteristic

Description

Syntax

public PrintWriter getLogWriter() throws SQLException

Return

The log writer for this connection pool data source object is returned; a null if disabled.

getPooledConnection()

Function: Attempts to establish a database connection which can be used as a pooled connection.

Characteristic

Description

Syntax

public PooledConnection getPooledConnection() throws SQLException

Return

A pooled connection to the database is returned.

getPooledConnection(String username, String password)

Function: Attempts to establish a database connection which can be used as a pooled connection.

Characteristic

Description

Syntax

public PooledConnection getPooledConnection(String username, String password) throws SQLException

where the parameter:

  • username is the database user on whose behalf the Connection is being made
  • password is the user’s password

Return

A Connection to the database is returned.

setLoginTimeout(int seconds)

Function: Sets the maximum time in seconds that this connection pool data source object will wait while attempting to connect to a database.

Characteristic

Description

Syntax

public void setLoginTimeout(int seconds) throws SQLException

where the seconds parameter is the data source login time limit

Note:  Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. A value of zero specifies no timeout. When a DataSource object is created, the login timeout is initially zero.

setLogWriter(PrintWriter out)

Function: Sets the log writer for this connection pool data source object to the java.io.PrintWriter.object.

Characteristic

Description

Syntax

public void setLogWriter(PrintWriter out) throws SQLException

where the out parameter is the new log writer; to disable logging, set to null

Return

The log writer for this data source is returned; a null if disabled.

Note:  The log writer is a character output stream to which all logging and tracing messages for this data source object instance are printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on.

Messages printed to a data source specific log writer are not printed to the log writer associated with the java.sql.DriverManager class. When a DataSource object is created, the log writer is initially null; logging is disabled.

DatabaseMetaData Interface

Description

The DatabaseMetaData interface provides information about the database as a whole. Many DatabaseMetaData methods return a list of information as a ResultSet. Use the normal ResultSet methods such as getString and getInt to retrieve the returned information.

Some kinds of metadata are not available from the Teradata Database, and an empty ResultSet will be returned from those methods. A SQLException is thrown from methods that are unsupported by the Teradata JDBC Driver.

Many DatabaseMetaData methods have arguments to specify LIKE-predicate patterns to match object names. These method arguments have a name ending in the word Pattern, such as schemaPattern and tableNamePattern. If a search pattern argument is set to a null, that argument's criteria is to be dropped from the search. Within a pattern, the percent-sign character " % " is a wildcard that matches any sequence of zero or more characters, and the underscore character " _ " is a wildcard that matches any single character. To match a literal wildcard character in an object name, the wildcard character must be escaped (preceded) by a backslash character " \ ".

Beginning with Teradata JDBC Driver version 15.10.00.14, the LITERAL_UNDERSCORE=ON connection parameter will automatically escape all unescaped underscore characters in DatabaseMetaData method pattern arguments.

Methods

Supported

allProceduresAreCallable()

Yes

allTablesAreSelectable()

Yes

dataDefinitionCausesTransactionCommit()

Yes

dataDefinitionIgnoredInTransactions()

Yes

deletesAreDetected(int type)

Yes

doesMaxRowSizeIncludeBlobs()

Yes

getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern)

Yes

getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable)

Yes

getCatalogs()

Yes*

getCatalogSeparator()

Yes*

getCatalogTerm()

Yes*

getClientInfoProperties()

Yes

getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern)

Yes

getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)

Yes

getConnection()

Yes

getCrossReference(String primaryCatalog, String primarySchemaPattern, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable)

Yes

getDatabaseMajorVersion()

Yes

getDatabaseMinorVersion()

Yes

getDatabaseProductName()

Yes

getDatabaseProductVersion()

Yes

getDefaultTransactionIsolation()

Yes

getDriverMajorVersion()

Yes

getDriverMinorVersion()

Yes

getDriverName()

Yes

getDriverVersion()

Yes

getExportedKeys(String catalog, String schema, String table)

Yes

getExtraNameCharacters()

Yes

getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern)

Yes

getFunctions(String catalog, String schemaPattern, String functionNamePattern)

Yes

getIdentifierQuoteString()

Yes

getImportedKeys(String catalog, String schema, String table)

Yes

getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate)

Yes

getMaxBinaryLiteralLength()

Yes

getMaxCatalogNameLength()

Yes*

getMaxCharLiteralLength()

Yes

getMaxColumnNameLength()

Yes

getMaxColumnsInGroupBy()

Yes

getMaxColumnsInIndex()

Yes

getMaxColumnsInOrderBy()

Yes

getMaxColumnsInSelect()

Yes

getMaxColumnsInTable()

Yes

getMaxConnections()

Yes

getMaxCursorNameLength()

Yes

getMaxIndexLength()

Yes

getMaxProcedureNameLength()

Yes

getMaxRowSize()

Yes

getMaxSchemaNameLength()

Yes

getMaxStatementLength()

Yes

getMaxStatements()

Yes

getMaxTableNameLength()

Yes

getMaxTablesInSelect()

Yes

getMaxUserNameLength()

Yes

getNumericFunctions()

Yes

getPrimaryKeys(String catalog, String schema, String table)

Yes

getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern)

Yes

getProcedures(String catalog, String schemaPattern, String procedureNamePattern)

Yes

getProcedureTerm()

Yes

getResultSetHoldability()

Yes

getSchemas()

Yes

getSchemas(String catalog, String schemaPattern)

Yes

getSchemaTerm()

Yes

getSearchStringEscape()

Yes

getSQLKeywords()

Yes

getSQLStateType()

Yes

getStringFunctions()

Yes

getSuperTables(String, String, String)

Yes

getSuperTypes(String, String, String)

Yes

getSystemFunctions()

Yes

getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern)

Yes

getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types)

Yes

getTableTypes()

Yes

getTimeDateFunctions()

Yes

getTypeInfo()

Yes

getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types)

Yes

getURL()

Yes

getUserName()

Yes

getVersionColumns(String catalog, String schema, String table)

Yes

insertsAreDetected(int type)

Yes

isCatalogAtStart()

Yes*

isReadOnly()

Yes

locatorsUpdateCopy()

Yes

nullPlusNonNullIsNull()

Yes

nullsAreSortedAtEnd()

Yes

nullsAreSortedAtStart()

Yes

nullsAreSortedHigh()

Yes

nullsAreSortedLow()

Yes

othersDeletesAreVisible(int type)

Yes*

othersInsertsAreVisible(int type)

Yes*

othersUpdatesAreVisible(int type)

Yes*

ownDeletesAreVisible(int type)

Yes*

ownInsertsAreVisible(int type)

Yes*

ownUpdatesAreVisible(int type)

Yes*

storesLowerCaseIdentifiers()

Yes

storesLowerCaseQuotedIdentifiers()

Yes

storesMixedCaseIdentifiers()

Yes

storesMixedCaseQuotedIdentifiers()

Yes

storesUpperCaseIdentifiers()

Yes

storesUpperCaseQuotedIdentifiers()

Yes

supportsAlterTableWithAddColumn()

Yes

supportsAlterTableWithDropColumn()

Yes

supportsANSI92EntryLevelSQL()

Yes

supportsANSI92FullSQL()

Yes

supportsANSI92IntermediateSQL()

Yes

supportsBatchUpdates()

Yes

supportsCatalogsInDataManipulation()

Yes

supportsCatalogsInIndexDefinitions()

Yes

supportsCatalogsInPrivilegeDefinitions()

Yes

supportsCatalogsInProcedureCalls()

Yes

supportsCatalogsInTableDefinitions()

Yes

supportsColumnAliasing()

Yes

supportsConvert()

Yes

supportsConvert(int fromType, toType)

Yes

supportsCoreSQLGrammar()

Yes

supportsCorrelatedSubqueries()

Yes

supportsDataDefinitionAndDataManipulationTransactions()

Yes

supportsDataManipulationTransactionsOnly()

Yes

supportsDifferentTableCorrelationNames()

Yes

supportsExpressionsInOrderBy()

Yes

supportsExtendedSQLGrammar()

Yes

supportsFullOuterJoins()

Yes

supportsGeneratedKeys()

Yes

supportsGroupBy()

Yes

supportsGroupByBeyondSelect()

Yes

supportsGroupByUnrelated()

Yes

supportsIntegrityEnhancementFacility()

Yes

supportsLikeEscapeClause()

Yes

supportsLimitedOuterJoins()

Yes

supportsMinimumSQLGrammar()

Yes

supportsMixedCaseIdentifiers()

Yes

supportsMixedCaseQuotedIdentifiers()

Yes

supportsMultipleResultSets()

Yes

supportsMultipleTransactions()

Yes

supportsNonNullableColumns()

Yes

supportsOpenCursorsAcrossCommit()

Yes

supportsOpenCursorsAcrossRollback()

Yes

supportsOpenStatementsAcrossCommit()

Yes

supportsOpenStatementsAcrossRollback()

Yes

supportsOrderByUnrelated()

Yes

supportsOuterJoins()

Yes

supportsPositionedDelete()

Yes

supportsPositionedUpdate()

Yes

supportsResultSetConcurrency(int type, int concurrency)

Yes

supportsResultSetHoldability(int holdability)

Yes

supportsResultSetType(int type)

Yes

supportsSchemasInDataManipulation()

Yes

supportsSchemasInIndexDefinitions()

Yes

supportsSchemasInPrivilegeDefinitions()

Yes

supportsSchemasInProcedureCalls()

Yes

supportsSchemasInTableDefinitions()

Yes

supportsSelectForUpdate()

Yes

supportsStoredProcedures()

Yes

supportsSubqueriesInComparisons()

Yes

supportsSubqueriesInExists()

Yes

supportsSubqueriesInIns()

Yes

supportsSubqueriesInQuantifieds()

Yes

supportsTableCorrelationNames()

Yes

supportsTransactionIsolationLevel(int level)

Yes

supportsTransactions()

Yes

supportsUnion()

Yes

supportsUnionAll()

Yes

updatesAreDetected(int type)

Yes*

usesLocalFilePerTable()

Yes

usesLocalFiles()

Yes

Methods

The following subsections provide a brief description of each supported DatabaseMetaData method.

allProceduresAreCallable()

Function: Determines if all of the procedures returned by getProcedures can be called by the current user.

Characteristic

Description

Syntax

public boolean allProceduresAreCallable() throws SQLException

Return

True, if all of the procedures returned by getProcedures can be called by the current user

False, if they cannot be called by the current user

allTablesAreSelectable()

Function: Determines if all the tables returned by getTable can be selected by the current user.

Characteristic

Description

Syntax

public boolean allTablesAreSelectable() throws SQLException

Return

True, if all of the tables returned by getTable can be selected by the current user

False, if they cannot be selected by the current user

dataDefinitionCausesTransactionCommit()

Function: Determines if a data definition statement within a transaction forces the transaction to commit.

Characteristic

Description

Syntax

public boolean dataDefinitionCausesTransactionCommit() throws SQLException

Return

True, if a data definition statement within a transaction forces the transaction to commit

False, if a data definition statement within a transaction does not force the transaction to commit

dataDefinitionIgnoredInTransactions()

Function: Determines if a data definition statement within a transaction is ignored.

Characteristic

Description

Syntax

public boolean dataDefinitionIgnoredInTransactions() throws SQLException

Return

True, if a data definition statement within a transaction is ignored

False, if a data definition statement within a transaction is not ignored

deletesAreDetected(int type)

Function: Determines if a visible row delete can be detected by calling ResultSet.rowDeleted().

If deletesAreDetected() returns false, then deleted rows are removed from the ResultSet.

Characteristic

Description

Syntax

public boolean deletesAreDetected(int type) throws SQLException

Return

True, if changes are detected by the resultset type

False, if changes are not detected by the resultset type

doesMaxRowSizeIncludeBlobs()

Function: Determines if getMaxRowSize() includes LONGVARCHAR and LONGVARBINARY Blobs.

Characteristic

Description

Syntax

public boolean doesMaxRowSizeIncludeBlobs() throws SQLException

Return

True, if getMaxRowSize() includes LONGVARCHAR and LONGVARBINARY Blobs

False, if getMaxRowSize() does not include LONGVARCHAR and LONGVARBINARY Blobs

getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern)

Function: Retrieves a description of the given attribute of the given type for a user‑defined type (UDT) that is available in the given schema and catalog.

Descriptions are returned only for attributes of UDTs matching the catalog, schema, type, and attribute name criteria. They are ordered by:

This description does not contain inherited attributes.

Each column description includes:

Column

Description

TYPE_CAT String

Type catalog (may be null)

TYPE_SCHEM String

Type schema (may be null)

TYPE_NAME String

Type name

ATTR_NAME String

Attribute name

DATA_TYPE int

Attribute type SQL type from java.sql.Types

ATTR_TYPE_NAME String

Data source dependent type name. For a UDT, the type name is fully qualified.

For a REF, the type name is fully qualified and represents the target type of the reference type.

ATTR_SIZE int

Column size. For char or date types, this is the maximum number of characters. For numeric or decimal types, this is precision.

DECIMAL_DIGITS int

The number of fractional digits

NUM_PREC_RADIX int

Radix (typically either 10 or 2)

NULLABLE int

Is NULL allowed?

  • attributeNoNulls–Might not allow NULL values
  • attributeNullable–Definitely allows NULL values
  • attributeNullableUnknown–Nullability unknown

REMARKS String

Comment describing column (may be null)

ATTR_DEF String

Default value (may be null)

SQL_DATA_TYPE int

Not used

SQL_DATETIME_SUB int

Not used

CHAR_OCTET_LENGTH int

For char types, the maximum number of bytes in the column

ORDINAL_POSITION int

Index of column in table (starting at 1)

IS_NULLABLE String

NO–the column definitely does not allow NULL values

Yes–the column might allow NULL values. An empty string means unknown.

SCOPE_CATALOG String

Catalog of table that is the scope of a reference attribute (null if DATA_TYPE isn't REF)

SCOPE_SCHEMA String

Schema of table that is the scope of a reference attribute (null if DATA_TYPE isn't REF)

SCOPE_TABLE String

Source type of a distinct type or user-generated Ref type, SQL type from java.sql.Types (null if DATA_TYPE isn't DISTINCT or user-generated REF)

SOURCE_DATA_TYPE short

Source type of a distinct type or user-generated Ref type, SQL type from java.sql.Types (null if DATA_TYPE isn't DISTINCT or user-generated REF)

Characteristic

Description

Syntax

public ResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) throws SQLException

where the parameter:

  • catalog is a catalog name; must match the catalog name as it is stored in the database: "" –retrieve those without a catalog null –drop catalog name from the selection criteria
  • schemaPattern is a schema name; must match the schema name as it is stored in the database: "" –retrieve those without a schema. null –drop schema name from the selection criteria
  • typeNamePattern is a type name pattern
  • attributeNamePattern is an attribute name pattern

Return

ResultSet–each row is an attribute description

getBestRowIdentifier(String catalog, String schema, string table, int scope, boolean nullable)

Function: Retrieves a description of a table’s optimal set of columns that uniquely identifies a row. They are ordered by SCOPE.

Each column description includes:

Column

Description

SCOPE Short

Actual scope of results:

  • bestRowTemporary –very temporary, while using row
  • bestRowTransaction–valid for remainder of current transaction
  • bestRowSession–valid for remainder of current session

COLUMN_NAME String

Column name

DATA_TYPE int

SQL data type from java.sql.Types

TYPE_NAME String

Data source dependent type name. For a UDT, the type name is fully qualified.

COLUMN_SIZE int

Precision

BUFFER_LENGTH int

Is not used

DECIMAL_DIGITS short

Scale

PSEUDO_COLUMN short

  • bestRowUnknown–may or may not be pseudo column
  • best RowNotPseudo–is NOT a pseudo column
  • bestRowPseudo–is a pseudo column

Characteristic

Description

Syntax

public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) throws SQLException

where the parameter:

  • catalog is a catalog name; must match the catalog name as it is stored in the database: " –retrieve those without a catalog null –the catalog name is not to be used to narrow the search
  • schema is a schema name pattern; must match the schema name as it is stored in the database: "" –retrieve those without a schema name null –the schema name is not to be used to narrow the search
  • table is a table name; must match the table name as it is stored in the database
  • scope is the scope of interest; use same values as SCOPE
  • nullable includes columns that are nullable

Return

ResultSet–each row is a column description

getCatalogs()

Function: Determines the catalog names available in the database.

Each catalog description includes:

Column

Description

TABLE_CAT String

Table catalog name

Characteristic

Description

Syntax

public ResultSet getCatalogs() throws SQLException

Return

The results are ordered by catalog name. Each row has a single String column that is a catalog name.

Note:  Currently returns a null. Will be changed in a future release to return an empty result set.

getCatalogSeparator()

Function: Determines the separator string between catalog and table name.

Characteristic

Description

Syntax

public String getCatalogSeparator() throws SQLException

Return

The separator string between catalog and table name is returned.

Note:  Always returns a "". Catalogs are not supported on the database.

Note:  Always returns a "". Catalogs are not supported on the database.

getCatalogTerm()

Function: Determines the preferred vendor term for catalog.

Characteristic

Description

Syntax

public String getCatalogTerm() throws SQLException

Return

The preferred vendor term for catalog is returned.

Note:  Always returns a ““. Catalogs are not supported on the database.

Note:  Always returns a ““. Catalogs are not supported on the database.

getClientInfoProperties()

Function: Retrieves a list of the client info properties that correspond to Query Band names recommended for use with the Teradata Database. Supported with the combination of JDK 6.0 or later, Teradata Database 14.00 or later, and Teradata JDBC Driver 13.10.00.12 or later.

The results are ordered by NAME.

Each client info property description includes:

Column

Description

NAME String

The name of the client info property, corresponding to the Query Band name

MAX_LEN int

The maximum length of the value for the property

DEFAULT_VALUE String

The default value of the property

DESCRIPTION String

A description of the property. This typically contains information as to where this property is stored in the database.

Characteristic

Description

Syntax

public ResultSet getClientInfoProperties() throws SQLException

Return

ResultSet–each row is a supported client info property

getColumnPrivileges(String catalog, String schema, String tableName, String columnNamePattern)

Function: Retrieves a description of the access rights for a table’s columns.

Only privileges matching the column name criteria are returned. They are ordered by:

Each privilege description includes:

Column

Description

TABLE_CAT String

Table catalog (may be null)

TABLE_SCHEM String

Table schema (may be null)

TABLE_NAME String

Table name

COLUMN_NAME String

Column name

GRANTOR String

Grantor of access (may be null)

GRANTEE String

Grantee of access

PRIVILEGE String

Name of access (SELECT, INSERT, UPDATE, REFRENCES, and so on)

IS_GRANTABLE String

YES if grantee is permitted to grant to others; NO if not; null if unknown

Characteristic

Description

Syntax

public ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) throws SQLException

where the parameter:

  • catalog is a catalog name; must match the catalog name as it is stored in the database: "" –retrieves those without a catalog null –the catalog name is not to be used to narrow the search
  • schema is a schema name pattern; must match the schema name as it is stored in the database: "" –retrieve those without a schema name null –the schema name is not to be used to narrow the search
  • table is a table name; must match the table name as it is stored in the database
  • columnNamePattern is a column name pattern; must match the column name as it is stored in the database

Return

ResultSet–each row is a column privilege description

Note:  See also the method getSearchStringEscape().

getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)

Function: Gets a description of table columns available in the specified catalog.

Only column descriptions matching the catalog, schema, table, and column name criteria are returned. They are ordered by:

Each column description includes:

Column

Description

TABLE_CAT String

Table catalog (may be null)

TABLE_SCHEM String

Table schema (may be null)

TABLE_NAME String

Table name

COLUMN_NAME String

Column name

DATA_TYPE int

SQL type from java.sql.Types

TYPE_NAME String

Data source dependent type name. For a UDT, the type name is fully qualified.

COLUMN_SIZE int

Column size. For char or date types, this is the maximum number of characters. For numeric or decimal types, this is precision.

BUFFER_LENGTH

Is not used

DECIMAL_DIGITS int

The number of fractional digits

NUM_PREC_RADIX int

Radix (typically either 10 or 2)

NULLABLE int

  • columnNoNulls–Might not allow NULL values
  • columnNullable–Definitely allows NULL values
  • columnNullableUnknown–Nullability unknown

REMARKS String

Comment describing column (may be null)

COLUMN_DEF String

Default value (may be null)

SQL_DATA_TYPE int

Not used

SQL_DATETIME_SUB int

Not used

CHAR_OCTET_LENGTH int

For char types, the maximum number of bytes in the column

ORDINAL_POSITION int

Index of column in table (starting at 1)

IS_NULLABLE String

NO–the column definitely does not allow NULL values

YES–the column might allow NULL values; an empty string means unknown

SCOPE_CATALOG String

Catalog of table that is the scope of a reference attribute (null if DATA_TYPE isn’t REF)

SCOPE_SCHEMA String

Schema of table that is the scope of a reference attribute (null if DATA_TYPE isn’t REF)

SCOPE_TABLE String

Table name that is the scope of a reference attribute (null if the DATA_TYPE isn't REF)

SOURCE_DATA_TYPE short

Source type of a distinct type or user-generated Ref type, SQL type from java.sql.Types (null if DATA_TYPE isn’t DISTINCT or user-generated REF)

Characteristic

Description

Syntax

public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException

where the parameter:

  • catalog is a catalog name ““ –retrieves those without a catalog null –drop catalog name from the selection criteria
  • schemaPattern is a schema name pattern ““ –retrieves those without a schema null –drop schema name from the selection criteria
  • tableNamePattern is a table name pattern
  • columnNamePattern is a column name pattern

Return

ResultSet with each row providing a column description

Note:  See also the method getSearchStringEscape().

getConnection()

Function: Retrieves the connection that produced this metadata object.

Characteristic

Description

Syntax

public Connection getConnection() throws SQLException

Return

The connection that produced this metadata object is returned.

getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable)

Function: Retrieves a description of the foreign key columns in the given foreign key table that reference the primary key columns of the given primary key table (describe how one table imports another’s key).

This normally returns a single foreign key/primary key pair because most tables import a foreign key from a table only once.

They are ordered by:

Each column description includes:

Column

Description

PKTABLE_CAT String

Primary key table catalog (may be null)

PKTABLE_SCHEM String

Primary key table schema (may be null)

PKTABLE_NAME String

Primary key table name

PKCOLUMN_NAME String

Primary key column name

FKTABLE_CAT String

Foreign key table catalog (may be null) being exported (may be null)

FKTABLE_SCHEM String

Foreign key table schema (may be null) being exported (may be null)

FKTABLE_NAME String

Foreign key column name being exported

FKCOLUMN_NAME String

Foreign key column name being exported

KEY_SEQ short

Sequence number within foreign key

UPDATE_RULE short

What happens to foreign key when primary is updated:

  • importedNoAction–do not allow update of primary key if it has been imported
  • importedKeyCascade–change imported key to agree with primary key update
  • importedKeySetNull–change imported key to NULL if its primary key has been updated
  • importedKeySetDefault–change imported key to default values if its primary key has been updated
  • importedKeyRestrict–same as importedKeyNoAction (for ODBC 2.x compatibility)

DELETE_RULE short

What happens to the foreign key when primary is deleted:

  • importedKeyNoAction–do not allow delete of primary key if it has been imported.
  • importedKeyCascade–delete rows that import a deleted key.
  • importedKeySetNull–change imported key to NULL if its primary key has been deleted.
  • importedKeyRestrict–same as importedKeyNoAction (for ODBC 2.x compatibility).
  • importedKeySetDefault–change imported key to default if its primary key has been deleted.

FK_NAME String

Foreign key name (may be null)

PK_NAME String

Primary key name (may be null)

DEFERRABILITY short

Can the evaluation of foreign key constraints be deferred until commit:

  • importedKeyInitiallyDeferred–Actions related to foreign keys are initially deferred
  • importedKeyInitiallyImmediate –Actions related to foreign keys are initially immediate
  • importedKeyNotDeferrable–Actions related to foreign keys are not deferrable

Characteristic

Description

Syntax

public ResultSet getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException

where the parameter:

  • primaryCatalog is a catalog name; must match the catalog name as it is stored in the database: ““ –retrieves those without a catalog null –drop catalog name from the selection criteria
  • primarySchema is a schema name pattern; must match the schema name as it is stored in the database: ““ –retrieves those without a schema null –drop schema name from the selection criteria
  • primaryTable is the name of the table that exports the key; must match the table name as it is stored in the database
  • foreignCatalog is a catalog name; must match the catalog name as it is stored in the database: ““ –retrieves those without a catalog null –drop catalog name from the selection criteria
  • foreignSchema is a schema name; must match the schema name as it is stored in the database: ““ –retrieves those without a schema null –drop schema name from the selection criteria
  • foreignTable is the name of the table that imports the key; must match the table name as it is stored in the database

Return

ResultSet–each row is a foreign key column description

Note:  See also the getImportedKeys(String, String, String) method.

getDatabaseMajorVersion()

Function: Retrieves the major version number of the underlying database.

Characteristic

Description

Syntax

public int getDatabaseMajorVersion()

Returns

The underlying database’s major version is returned.

Note:  The major version is the value following the letter V for supported database releases prior to 12.0, such as it returns value 2 for database release V2R6, but it returns value 12 for database release 12.0.

getDatabaseMinorVersion()

Function: Retrieves the minor version number of the underlying database.

Characteristic

Description

Syntax

public int getDatabaseMinorVersion()

Return

The underlying database’s minor version is returned.

Note:  The minor version is the value following the letter R for supported database releases prior to 12.0, such as it returns value 6 for database release V2R6, but it returns value 0 for database release 12.0.

getDatabaseProductName()

Function: Determines the name of this database product.

Characteristic

Description

Syntax

public String getDatabaseProductName() throws SQLException

Return

The database product name is returned.

getDatabaseProductVersion()

Function: Determines the version of this database product.

Characteristic

Description

Syntax

public String getDatabaseProductVersion() throws SQLException

Return

The database version is returned.

Note:  The database version is a string that always begins with Teradata Database and that includes V2R for supported database releases prior to 12.0, but does not include V2R for 12.0.

getDefaultTransactionIsolation()

Function: Determines the default transaction isolation level of the database

Characteristic

Description

Syntax

public int getDefaultTransactionIsolation() throws SQLException

Return

The default isolation level is returned.

Note:  The values are defined in java.sql.Connection.

getDriverMajorVersion()

Function: Determines this JDBC Driver’s major version number.

Characteristic

Description

Syntax

public int getDriverMajorVersion()

Return

The JDBC Driver major version number is returned.

getDriverMinorVersion()

Function: Determines this JDBC Driver’s minor version number

Characteristic

Description

Syntax

public int getDriverMinorVersion()

Return

The JDBC Driver minor version number is returned.

getDriverName()

Function: Determines the name of this JDBC Driver.

Characteristic

Description

Syntax

public String getDriverName() throws SQLException

Return

The JDBC Driver name is returned.

getDriverVersion()

Function: Determines the version of this JDBC Driver.

Characteristic

Description

Syntax

public String getDriverVersion() throws SQLException

Return

The JDBC Driver version is returned.

getExtraNameCharacters()

Function: Gets all the extra characters that can be used in unquoted identifier names; those beyond a-z, A-Z, 0-9, and _.

Characteristic

Description

Syntax

public String getExtraNameCharacters() throws SQLException

Return

The string containing extra characters is returned.

getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern)

Function: Gets a description of function parameters, return types, and columns, available in the specified catalog.

Only descriptions matching the catalog, schema, function, and column name criteria are returned. They are ordered by:

Each description includes:

Column

Description

FUNCTION_CAT String

Function catalog (may be null)

FUNCTION_SCHEM String

Function schema (may be null)

FUNCTION_NAME String

Function name

COLUMN_NAME String

Parameter, return type, or column name

COLUMN_TYPE short

  • functionColumnUnknown - unknown type
  • functionColumnIn - IN parameter
  • functionColumnInOut - INOUT parameter
  • functionColumnOut - OUT parameter
  • functionColumnResult - ResultSet column
  • functionReturn - function return type

DATA_TYPE int

SQL type from java.sql.Types

TYPE_NAME String

Data source dependent type name. For a UDT, the type name is fully qualified.

PRECISION int

Numeric precision

LENGTH int

Parameter, return type, or column length

SCALE short

The number of fractional digits

RADIX short

Radix (typically either 10 or 2)

NULLABLE short

  • functionNoNulls - forbids NULL values
  • functionNullable - allows NULL values
  • functionNullableUnknown - unknown nullability

REMARKS String

Comment describing parameter, return type, or column (may be null)

CHAR_OCTET_LENGTH int

Parameter, return type, or column length

ORDINAL_POSITION int

Ordinal position, starting from 1, of the parameter or column, or 0 for a return type

IS_NULLABLE String

NO - forbids NULL values

YES - allows NULL values

empty string - unknown nullability

SPECIFIC_NAME String

Unique function name that may differ from FUNCTION_NAME for an overloaded function

Characteristic

Description

Syntax

public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException

where the parameter:

  • catalog is a catalog name. The empty string retrieves those without a catalog, and null omits the catalog from the selection criteria.
  • schemaPattern is a schema name pattern. The empty string retrieves those without a schema, and null omits the schema from the selection criteria.
  • functionNamePattern is a function name pattern
  • columnNamePattern is a parameter, return type, or column name pattern

Return

ResultSet with each row providing a parameter description, column description, or return type description

Note:  This method is supported beginning with Teradata JDBC Driver 15.10.00.28.

JDK 6.0 or later is required to use this method.

See also the method getSearchStringEscape().

getFunction(String catalog, String schemaPattern, String functionNamePattern)

Function: Gets a description of functions available in the specified catalog.

Only functions matching the catalog, schema, and function name criteria are returned. They are ordered by:

Each description includes:

Column

Description

FUNCTION_CAT String

Function catalog (may be null)

FUNCTION_SCHEM String

Function schema (may be null)

FUNCTION_NAME String

Function name

REMARKS String

Comment describing the function (may be null)

FUNCTION_TYPE short

  • functionReturnsTable - table function or table operator
  • functionNoTable - function does not return a table

SPECIFIC_NAME String

Unique function name that may differ from FUNCTION_NAME for an overloaded function

Characteristic

Description

Syntax

public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) throws SQLException

where the parameter:

  • catalog is a catalog name. The empty string retrieves those without a catalog, and null omits the catalog from the selection criteria.
  • schemaPattern is a schema name pattern. The empty string retrieves those without a schema, and null omits the schema from the selection criteria.
  • functionNamePattern is a function name pattern

Return

ResultSet with each row providing a function description

Note:  This method is supported beginning with Teradata JDBC Driver 15.10.00.28.

JDK 6.0 or later is required to use this method.

See also the method getSearchStringEscape().

getIdentifierQuoteString()

Function: Determines the string used to quote SQL identifiers.

Characteristic

Description

Syntax

public String getIdentifierQuoteString() throws SQLException

Return

If identifier quoting is supported, it returns the string used to quote SQL identifiers;

If identifier quoting is not supported, a space is returned

Note:  A JDBC-compliant driver always uses a double-quote character.

getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate)

Function: Gets a description of the indices and statistics for a table.

They are ordered by NON_UNIQUE, TYPE, INDEX_NAME, and ORDINAL_POSITION.

Each index column description includes:

Column

Description

TABLE_CAT String

Table catalog (may be null)

TABLE_SCHEM String

Table schema (may be null)

TABLE_NAME String

Table name

NON_UNIQUE String

Can index values be non-unique? False when TYPE is tableIndexStatistic

INDEX_QUALIFIER String

Index catalog (may be null), null when TYPE is tableIndexStatistic. Teradata JDBC Driver 14.00.00.25 and later, in conjunction with Teradata Database 14.10 and later, provide the database name of join and hash indexes.

INDEX_NAME String

Index Name. null when TYPE is tableIndexStatistic, or when the index is unnamed.

Teradata permits unnamed indices; refer to the Teradata SQL Reference Data Definition Statements for more information.

TYPE short

Index Type:

  • tableIndexStatistic identifies the table statistics that are returned in conjunction with a table's index descriptions. Teradata JDBC Driver 14.00.00.24 and later do not provide tableIndexStatistic.
  • tableIndexClustered identifies a clustered index. Teradata JDBC Driver 14.00.00.24 and later identify primary indexes as tableIndexClustered. While Teradata Database primary indexes are not actually clustered indexes, they are conceptually similar in that a primary index is the "most important" index for a base table, and there can be at most one primary index per base table.
  • tableIndexHashed identifies a hashed index. Teradata JDBC Driver 14.00.00.24 and later identify secondary indexes as tableIndexHashed. Teradata Database unique secondary indexes (USI) are hash-distributed, but Teradata Database non-unique secondary indexes (NUSI) are not hash-distributed. However, for consistency, both kinds of secondary indexes are identified as tableIndexHashed.
  • tableIndexOther identifies some other style of index. Teradata JDBC Driver 14.00.00.24 and later identify join and hash indexes as tableIndexOther.

ORDINAL_POSITION short

Column sequence number within index. Zero when TYPE is tableIndexStatistic.

COLUMN_NAME String

Column Name. Null when TYPE is tableIndexStatistic.

ASC_OR_DESC String

Column sort sequence:

  • A (ascending)
  • D (descending)

May be null if sort sequence is not supported. Null when TYPE is tableIndexStatistic.

CARDINALITY int

When TYPE is tableIndexStatistic, this is the number of rows in the table. Otherwise, it is the number of unique values in the Index.

PAGES int

When TYPE is tableIndexStatistic, this is the number of pages used for the table. Otherwise, it is the number of pages used for the current index. Teradata JDBC Driver 14.00.00.24 and later provide null.

FILTER_CONDITION String

Filter conditions, if any (may be null)

Characteristic

Description

Syntax

public ResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) throws SQLException

where the parameter:

  • catalog is a catalog name: ““ –retrieves those without a catalog null –drop catalog name from the selection criteria
  • schema is a schema name: ““ –retrieves those without a schema
  • table is a table name
  • unique is indice uniqueness: True–returns only indices for unique values False–returns indices regardless of whether unique or not
  • approximate is approximate values: True–result is allowed to reflect approximate or out-of-data values False–results are requested to be accurate

Return

ResultSet–each row is an index column description

getMaxBinaryLiteralLength()

Function: Determines how many hex characters are permitted in an in line binary literal.

Characteristics

Description

Syntax

public int getMaxBinaryLiteralLength() throws SQLException

Return

The maximum binary literal length in hex characters is returned.

Note:  A result of zero indicates that there is no limit to the binary literal or the limit is unknown.

getMaxCatalogNameLength()

Function: Determines the maximum length of a catalog name.

Characteristic

Description

Syntax

public int getMaxCatalogNameLength() throws SQLException

Return

The maximum catalog name length in bytes is returned.

Note:  A result of zero indicates that there is no limit to the catalog name or the limit is unknown.

getMaxCharLiteralLength()

Function: Determines the maximum length for a character literal.

Characteristic

Description

Syntax

public int getMaxCharLiteralLength() throws SQLException

Return

The maximum literal length is returned.

Note:  A result of zero indicates that there is no limit to the Character literal or the limit is unknown.

getMaxColumnNameLength()

Function: Determines the limit on column name length.

Characteristic

Description

Syntax

public int getMaxColumnNameLength() throws SQLException

Return

The maximum literal length for a column name is returned.

getMaxColumnsInGroupBy()

Function: Determines the maximum number of columns in a GROUP BY clause.

Characteristic

Description

Syntax

public int getMaxColumnsInGroupBy() throws SQLException

Return

The maximum number of columns in a GROUP BY clause is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxColumnsInIndex()

Function: Determines the maximum number of columns allowed in an index.

Characteristic

Description

Syntax

public int getMaxColumnsInIndex() throws SQLException

Return

The maximum number of columns allowed in an index is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxColumnsInOrderBy()

Function: Determines the maximum number of columns allowed in an ORDER BY clause.

Characteristic

Description

Syntax

public int getMaxColumnsInOrderBy() throws SQLException

Return

The maximum number of columns allowed in an ORDER BY clause is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxColumnsInSelect()

Function: Determines the maximum number of columns allowed in a SELECT list.

Characteristic

Description

Syntax

public int getMaxColumnsInSelect() throws SQLException

Return

The maximum number of columns allowed in a SELECT list is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxColumnsInTable()

Function: Determines the maximum number of columns allowed in a table.

Characteristic

Description

Syntax

public int getMaxColumnsInTable() throws SQLException

Return

The maximum number of columns allowed in a table is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxConnections()

Function: Determines how many active connections are allowed at a time to this database.

Characteristic

Description

Syntax

public int getMaxConnections() throws SQLException

Return

The maximum active connections allowed at a time to this database is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxCursorNameLength()

Function: Determines the maximum cursor name length in bytes.

Characteristic

Description

Syntax

public int getMaxCursorNameLength() throws SQLException

Return

The maximum cursor name length in bytes is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxIndexLength()

Function: Determines the maximum length of an index in bytes.

Characteristic

Description

Syntax

public int getMaxIndexLength() throws SQLException

Return

The maximum length of an index in bytes is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxProcedureNameLength()

Function: Determines the maximum length of a procedure name.

Characteristic

Description

Syntax

public int getMaxProcedureNameLength() throws SQLException

Return

The maximum procedure name length in bytes is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxRowSize()

Function: Determines the maximum length of a single row in bytes.

Characteristic

Description

Syntax

public int getMaxRowSize() throws SQLException

Return

The maximum length of a single row in bytes is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxSchemaNameLength()

Function: Determines the maximum length allowed for a schema name in bytes.

Characteristic

Description

Syntax

public int getMaxSchemaNameLength() throws SQLException

Return

The maximum length allowed for a schema name in bytes is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxStatementLength()

Function: Determines the maximum length of an SQL statement in bytes.

Characteristic

Description

Syntax

public int getMaxStatementLength() throws SQLException

Return

The maximum length of an SQL statement in bytes is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxStatements()

Function: Determines how many active statements can be open at any one time.

Characteristic

Description

Syntax

public int getMaxStatements() throws SQLException

Return

The maximum number of active statements allowed at one time is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxTableNameLength()

Function: Determines the maximum length of a table name in bytes.

Characteristic

Description

Syntax

public int getMaxTableNameLength() throws SQLException

Return

The maximum length of a table name in bytes is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxTablesInSelect()

Function: Determines the maximum number of tables in a SELECT statement.

Characteristic

Description

Syntax

public int getMaxTablesInSelect() throws SQLException

Return

The maximum number of tables allowed in a SELECT statement is returned.

Note:  A result of zero indicates that there is no limit or the limit is unknown.

getMaxUserNameLength()

Function: Determines the maximum length of a user name.

Characteristic

Description

Syntax

public int getMaxUserNameLength() throws SQLException

Return

The maximum user name length in bytes is returned.

Note:  Zero indicates that there is no limit or the limit is not known.

getNumericFunctions()

Function: Gets a comma-separated list of the X/Open CLI math function names in JDBC function escape clauses.

Characteristic

Description

Syntax

public String getNumericFunctions() throws SQLException

Return

The list of math functions is returned.

getPrimaryKeys(String catalog, String schema, String table)

Function: Gets a description of a table’s primary key columns. They are ordered by COLUMN_NAME.

Each primary key column description has the following columns:

Column

Description

TABLE_CAT String

Table catalog (may be null)

TABLE_SCHEM String

Table schema (may be null)

TABLE_NAME String

Table name

COLUMN_NAME String

Column name

KEY_SEQ short

Sequence number within primary key

PK_NAME String

Primary key name (may be null)

Characteristic

Description

Syntax

public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException

where the parameter:

  • catalog is a catalog name: ““ –retrieves those without a catalog null –drop catalog name from the selection criteria
  • schema is a schema name: ““ –retrieves those without a schema
  • table is a table name

Return

ResultSet–each row is a primary key column description

getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern)

Function: Gets a description of the stored procedure parameters and result columns of a catalog.

Characteristic

Description

Syntax

public ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException

where the parameter:

  • catalog is a catalog name: ““ –retrieves those without a catalog null –drop catalog name from the selection criteria
  • schemaPattern is a schema name pattern: ““ –retrieves those without a schema null –drop schema name from the selection criteria
  • procedureNamePattern is a procedure name pattern
  • columnNamePattern is a column name pattern

Return

Descriptions matching the schema, procedure, and parameter name criteria, ordered by PROCEDURE_SCHEM and PROCEDURE_NAME. Within this, the return value, if any, is first. Next are the parameter descriptions in call order.

The column descriptions follow in column number order.

Each row in the ResultSet is a parameter description or column description with the following fields:

Column

Description

PROCEDURE_CAT String

Procedure catalog (may be null)

PROCEDURE_SCHEM String

Procedure schema (may be null)

PROCEDURE_NAME String

Procedure name

COLUMN_NAME String

Column/parameter name

COLUMN_TYPE short

Type of column parameter:

  • procedureColumnUnknown–nobody knows
  • procedureColumnIn–the IN parameter
  • procedureColumnInOut–the INOUT parameter
  • procedureColumnOut–the OUT parameter
  • procedureColumnReturn–procedure return value
  • procedureColumnResult–result column in ResultSet

DATA_TYPE int

SQL type from java.sql.Types

TYPE_NAME String

SQL type name; for a UDT type, the type name is fully qualified

PRECISION int

Precision

LENGTH int

Length in bytes of data

SCALE short

Scale

RADIX short

Radix

NULLABLE short

Can it contain NULL?

  • procedureNoNulls–does not allow NULL values
  • procedureNullable–allows NULL values
  • procedureNullableUnknown

REMARKS String

Comment describing parameter/column

Note:  Some databases may not return the column descriptions for a procedure. Additional columns beyond REMARKS can be defined by the database.

getProcedures(String catalog, String schemaPattern, String procedureNamePattern)

Function: Gets a description of the stored procedures available in a catalog.

Characteristic

Description

Syntax

public ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) throws SQLException

where the parameter:

  • catalog is a catalog name: ““ –retrieves those without a catalog null –drop catalog name from the selection criteria
  • schemaPattern is a schema name pattern: ““ –retrieves those without a schema
  • procedureNamePattern is a procedure name pattern

Return

ResultSet where each row is a procedure description, ordered by PROCEDURE_SCHEM and PROCEDURE_NAME.

Each procedure description has the following columns:

Column

Description

PROCEDURE_CAT String

Procedure catalog (may be null)

PROCEDURE_SCHEM String

Procedure schema (may be null)

PROCEDURE_NAME String

Procedure name

Reserved

Reserved for future use

Reserved

Reserved for future use

Reserved

Reserved for future use

REMARKS String

Explanatory comment on the procedure

PROCEDURE_TYPE short

Type of procedure:

  • procedureResultunknown–may return result
  • procedureNoResult–does not return guilty
  • procedureReturnsResult–returns a result

getProcedureTerm()

Function: Determines the database vendor preferred term for procedure.

Characteristic

Description

Syntax

public String getProcedureTerm() throws SQLException

Return

The database vendor’s preferred term for procedure is returned.

getResultSetHoldability()

Function: Retrieves the default holdability of this ResultSet object.

Characteristic

Description

Syntax

public int getResultSetHoldability() throws SQLException

Return

The default holdability: ResultSet_HOLD_CURSORS_OVER_COMMIT is returned.

getSchemas()

Function: Retrieves the schema names available in this database. They are ordered by TABLE_SCHEM.

Each description includes:

Column

Description

TABLE_SCHEM String

Schema name

TABLE_CATALOG String

Catalog (may be null)

Characteristic

Description

Syntax

public ResultSet getSchemas() throws SQLException

Return

ResultSet with each row providing a schema description

getSchemas(String catalog, String schemaPattern)

Function: Retrieves the schema names available in this database.

Only schemas matching the catalog and schema name criteria are returned. They are ordered by TABLE_SCHEM.

Each description includes:

Column

Description

TABLE_SCHEM String

Schema name

TABLE_CATALOG String

Catalog (may be null)

Characteristic

Description

Syntax

public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException

where the parameter:

  • catalog is a catalog name. The empty string retrieves those without a catalog, and null omits the catalog from the selection criteria.
  • schemaPattern is a schema name pattern. The empty string retrieves those without a schema, and null omits the schema from the selection criteria.

Return

ResultSet with each row providing a schema description

Note:  This method is supported beginning with Teradata JDBC Driver 15.10.00.28.

JDK 6.0 or later is required to use this method.

See also the method getSearchStringEscape().

getSchemaTerm()

Function: Determines the term for schema that is preferred by the database vendor.

Characteristic

Description

Syntax

public String getSchemaTerm() throws SQLException

Return

The term for schema that is preferred by the database vendor is returned.

getSearchStringEscape()

Function: Gets the string that can be used to escape wildcard characters.

This is the string that can be used to escape “_” or “%” in the string pattern style catalog search parameters where:

Characteristic

Description

Syntax

public String getSearchStringEscape() throws SQLException

Return

The string used to escape wildcard characters is returned.

getSQLKeywords()

Function: Gets a comma-separated list of all the SQL keywords in a database that are NOT also SQL92 keywords.

Characteristic

Description

Syntax

public String getSQLKeywords() throws SQLException

Return

The list of keywords is returned.

getStringFunctions()

Function: Gets a comma-separated list of X/Open CLI string function names used in the JDBC function escape clause.

Characteristic

Description

Syntax

public String getStringFunctions() throws SQLException

Return

The list of string functions is returned.

getSystemFunctions()

Gets a comma-separated list of X/Open CLI system function names.

These are the X/Open CLI system function names used in the JDBC function escape clause.

Characteristic

Description

Syntax

public String getSystemFunctions() throws SQLException

Return

The list of system functions is returned.

getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern)

Function: Retrieves a description of the access rights for each table available in a catalog. Note that a table privilege applies to one or more columns in the table. It is wrong to assume that this privilege applies to all columns (this may be true for some systems, but is not true for all).

Only privileges matching the schema and table name criteria are returned; ordered by:

Each table description includes:

Column

Description

TABLE_CAT String

Table catalog (may be null)

TABLE_SCHEM String

Table schema (may be null)

TABLE_NAME String

Table name

GRANTOR String

Grantor of access (may be null)

GRANTEE String

Grantee of access

PRIVILEGE String

Name of access (SELECT, INSERT, UPDATE, REFERENCES, and so on)

IS_GRANTABLE String

YES if grantee is permitted to grant to others; NO if not; null if unknown

Characteristic

Description

Syntax

public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern)throws SQLException

where the parameter:

  • catalog is a catalog name; must match the catalog name as it is stored in the database: ““ –retrieves those without a catalog null –the catalog name should not be used to narrow the search
  • schemaPatternis a schema name pattern; must match the schema name as it is stored in the database: ““ –retrieves those without a schema null –the schema name should not be used to narrow the search
  • tableNamePattern is a table name pattern; must match the table name as it is stored in the database

Return

ResultSet–each row is a table privilege description

Note:  See also the method getSearchStringEscape().

getTables(String catalog, String schemaPattern, String tableNamePattern, String[ ] types)

Function: Gets a description of tables available in a catalog, ordered by:

Only table descriptions matching the catalog, schema, table name, and type criteria are returned.

Each table description includes:

Column

Description

TABLE_CAT String

Table catalog (may be null)

TABLE_SCHEM String

Table schema (may be null)

TABLE_NAME String

Table name

TABLE_TYPE String

Table type. Typical types are:

  • TABLE
  • VIEW
  • SYSTEM TABLE
  • GLOBAL TEMPORARY
  • LOCAL TEMPORARY
  • ALIAS
  • SYNONYM

REMARKS String

Explanatory comment on the table

Characteristic

Description

Syntax

public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException

where the parameter:

  • catalog is a catalog name: ““ –retrieves those without a catalog null –drop catalog name from the selection criteria
  • schemaPattern is a schema name pattern; ““ –retrieves those without a schema
  • tableNamePattern is a table name pattern
  • types is a list of table types to include: null –returns all types

Return

ResultSet–each row is a table description

Note:  Some databases may not return information for all tables.

See also the method getSearchStringEscape().

getTableTypes()

Function: Gets the table types available in the database system. The results are ordered by table types.

Characteristic

Description

Syntax

public getTableTypes() throws SQLException

where the TABLE_TYPE String

column is a table type. Typical types are:

  • TABLE
  • VIEW
  • SYSTEM TABLE
  • GLOBAL TEMPORARY
  • LOCAL TEMPORARY
  • ALIAS
  • SYNONYM

Return

A ResultSet object with each row as a single string column is a table type

getTimeDateFunctions()

Function: Gets a comma-separated list of time and date functions.

Characteristic

Description

Syntax

public String getTimeDateFunctions() throws SQLException

Return

The list of time and date functions is returned.

getTypeInfo()

Function: Gets a description of all the standard SQL types supported by this database. They are ordered by DATA_TYPE and then by how closely the data type maps to the corresponding JDBC SQL type.

Each type description has the following columns:

Column

Description

TYPE_NAME String

Type name

DATA_TYPE Short

SQL data type from java.sql.Types

PRECISION int

Maximum precision

LITERAL_PREFIX String

Prefix used to quote a literal (may be null)

LITERAL_SUFFIX String

Suffix used to quote a literal (may be null)

CREATE_PARAMS String

Parameters used in creating the type (may be null)

NULLABLE short

Indicating whether the column can be a null”

  • type NoNulls–does not allow NULL values
  • type Nullable–allows NULL values
  • type NullableUnknown

CASE_SENSITIVE boolean

True to indicate that the type is case-sensitive

False indicates that it is not case-sensitive

SEARCHABLE Short

Indicates whether it is possible to use a WHERE clause:

  • typePredNone–no support
  • typePredChar–only supported with WHERE....LIKE
  • typePredBasic–support except for WHERE....LIKE
  • typeSearchable–support for all WHERE

UNSIGNED_ATTRIBUTE boolean

True indicates the type is unsigned

False indicates that it is signed

FIXED_PREC_SCALE boolean

True indicates the type can be a money value

False indicates that the type cannot be a money value

AUTO_INCREMENT boolean

True indicates the type can be used for auto-increment

False indicates that the type cannot be used for auto-increment

LOCAL_TYPE_NAME String

Localized version of type name (may be null)

MINIMUM_SCALE short

Minimum scale supported

MAXIMUM_SCALE short

Maximum scale supported

SQL_DATA_TYPE int

Unused

SQL_DATETIME_SUB int

Unused

NUM_PREC_RADIX int

Usually 2 or 10

Characteristic

Description

Syntax

public ResultSet getTypeInfo() throws SQLException

Return

ResultSet–each row is an SQL type description

getUDTs(String catalog, String schemaPattern, string typeNamePattern, int[ ] types)

Function: Retrieves a description of the UDTs defined in a particular schema. UDTs may have type JAVA_OBJECT, STRUCT, or DISTINCT.

Only types matching the catalog, schema, type name, and type criteria are returned. They are ordered by:

The type name parameter may be a fully qualified name. In this case, the catalog and schemaPattern parameters are ignored.

Column

Description

TYPE_CAT String

The type’s catalog (may be null)

TYPE_SCHEM String

Type’s schema (may be null)

TYPE_NAME String

Type name

CLASS_NAME String

Java class name

DATA_TYPE int

Type value defined in java.sql.Types. One of JAVA_OBJECT, STRUCT, or DISTINCT.

REMARKS String

Explanatory comment on the type

BASE_TYPE short

Type code of the source type of a DISTINCT type or the type that implements the user-generated reference type of the SELF_REFERENCING_COLUMN of a structured type as defined in java.sql.Types (null if DATA_TYPE is not DISTINCT or not STRUCT with REFERENCE_GENERATION = USER_DEFINED).

Characteristic

Description

Syntax

public ResultSet getUDTs(String catalog, String schemaPattern, string typeNamePattern, int[] types) throws SQLException

where the parameter:

  • catalog is a catalog name: ““ –retrieve those without a catalog null –drop catalog name from the selection criteria
  • schemaPattern is a schema name pattern: ““ –retrieve those without a schema null –drop schema name from the selection criteria
  • typeNamePattern is a type name pattern
  • types is a list of user-defined types (JAVA_OBJECT, STRUCT, or DISTINCT) to include; null –returns all types

Return

ResultSet–each row describes a UDT

getURL()

Function: Determines the URL for this database.

Characteristic

Description

Syntax

public String getURL() throws SQLException

Return

The complete connection URL, beginning with Teradata JDBC Driver 16.00.00.28.

Or return a "synthesized" URL string based on the data source property values for a connection originally created from a DataSource or ConnectionPoolDataSource, beginning with Teradata JDBC Driver 16.00.00.28.

Or return the connection URL prefix, for Teradata JDBC Driver versions prior to Teradata JDBC Driver 16.00.00.28.

Note:  Beginning with Teradata JDBC Driver 16.00.00.28, the GETURL_CREDENTIALS connection parameter affects the behavior of this method.

  • When the GETURL_CREDENTIALS connection parameter is set to OFF (the default), the URL string returned by this method will not contain the USER, PASSWORD, or NEW_PASSWORD connection parameters.
  • When the GETURL_CREDENTIALS connection parameter is set to ON, this method will return a URL string containing the USER, PASSWORD, and NEW_PASSWORD connection parameters, if available. This option should be used with caution, since exposing the connection's credentials may pose a security risk.

getUserName()

Function: Determines your user name, as known to the database.

Characteristic

Description

Syntax

public String getUserName() throws SQLException

Return

Your database user name is returned.

getVersionColumns(String catalog, String schema, string table)

Function: Retrieves a description of a table’s columns that are automatically updated when any value in a row is updated. They are unordered.

Each column description has the following columns:

Column

Description

SCOPE short

Is not used

COLUMN_NAME String

Column name

DATA_TYPE int

SQL data type from java.sql.Types

TYPE_NAME String

Data source-dependent type name

COLUMN_SIZE int

Precision

BUFFER_LENGTH int

Length of column value in bytes

DECIMAL_DIGITS short

Scale

PSEUDO_COLUMN short

Determines if this is pseudo column like an Oracle ROWID:

  • versionColumnUnknown–may or may not be pseudo column
  • versionColumnNotPseudo–is NOT a pseudo column
  • versionColumnPseudo–is a pseudo column

Characteristic

Description

Syntax

getVersionColumns(String catalog, String schema, String table) throws SQLException

where the parameter:

  • catalog is a catalog name; must match the catalog name as it is stored in the database: ““ –retrieves those without a catalog null –the catalog name should not be used to narrow the search
  • schema is a schema name; must match the schema name as it is stored in the database: ““ –retrieves those without a schema null –the schema name should not be used to narrow the search
  • table is a table name; must match the table name as it is stored in the database

Return

A ResultSet object in which each row is a column description is returned.

Note:  Teradata implementation for getVersionColumns is limited and gives back only an empty resultset.

insertsAreDetected(int type)

Function: Determines if a visible row insert can be detected by calling ResultSet.rowInserted().

Characteristic

Description

Syntax

public boolean insertsAreDetected(int type) throws SQLException

where the parameter type is the ResultSet type, such as TYPE_XXX

Return

True, if changes are detected by the resultset type

False, if changes are not detected by the resultset type

isCatalogAtStart()

Function: Determines if a catalog appears at the start of a table.

Characteristic

Description

Syntax

public boolean isCatalogAtStart() throws SQLException

Return

True, if the catalog appears at the start of the table

False, if it does not appear at the start of the table

Note:  This method is supported by the Teradata JDBC Driver, but it is not supported by the Teradata Database. Teradata will return a null result set.

isReadOnly()

Function: Determines if the database is in read-only mode.

Characteristic

Description

Syntax

public boolean isReadOnly() throws SQLException

Return

True, if the database is in read-only mode

False, if the database is not in read-only mode

nullPlusNonNullIsNull()

Function: Determines if concatenations between NULL and nonNULL values is NULL.

Characteristic

Description

Syntax

public boolean nullPlusNonNullIsNull() throws SQLException

Return

True, if concatenations between NULL and nonNULL values are NULL

False, if concatenations between NULL and nonNULL values are not NULL

nullsAreSortedAtEnd()

Function: Determines if NULL values are sorted at the end, regardless of sort order.

Characteristic

Description

Syntax

public boolean nullsAreSortedAtEnd() throws SQLException

Return

True, if NULL values are sorted at the end, regardless of sort order

False, if NULL values are not sorted at the end

nullsAreSortedAtStart()

Function: Determines if NULL values are sorted at the start, regardless of sort order.

Characteristic

Description

Syntax

public boolean nullsAreSortedAtStart() throws SQLException

Return

True, if NULL values are sorted at the start, regardless of sort order

False, if NULL values are not sorted at the start

nullsAreSortedHigh()

Function: Determines if NULL values are sorted high.

Characteristic

Description

Syntax

public boolean nullsAreSortedHigh() throws SQLException

Return

True, if null values are sorted high

False, if null values are not sorted high

nullsAreSortedLow()

Function: Determines if NULL values are sorted low.

Characteristic

Description

Syntax

public boolean nullsAreSortedLow() throws SQLException

Return

True, if NULL values are sorted low

False, if null values are not sorted low

othersDeletesAreVisible(int type)

Function: Determines if deletes made by others are visible.

Characteristic

Description

Syntax

public boolean othersDeletesAreVisible(int type) throws SQLException

where the type parameter is the ResultSet type, such as TYPE_XXX

Return

True, if deletes made by others are visible for the ResultSet type

False, if deletes made by others are not visible for the ResultSet type

Note:  Always returns false, because updatable ResultSets are not supported.

othersInsertsAreVisible(int type)

Function: Determines if inserts made by others are visible.

Characteristic

Description

Syntax

public boolean othersInsertsAreVisible(int type) throws SQLException

where the type parameter is the ResultSet type, such as TYPE_XXX

Return

True, if inserts made by others are visible for the ResultSet type

False, if inserts made by others are not visible for the ResultSet type

Note:  Always returns false, because updatable ResultSets are not supported.

othersUpdatesAreVisible(int type)

Function: Determines if updates made by others are visible.

Characteristic

Description

Syntax

public boolean othersUpdatesAreVisible(int type) throws SQLException

where the type parameter is the ResultSet type, such as TYPE_XXX

Return

True, if updates made by others are visible for the ResultSet type

False, if updates made by others are not visible for the ResultSet type

Note:  Always returns false, because updatable ResultSets are not supported.

ownDeletesAreVisible(int type)

Function: Determines if the own deletes of a ResultSet are visible.

Characteristic

Description

Syntax

public boolean ownDeletesAreVisible(int type) throws SQLException

where the type parameter is the ResultSet type, such as TYPE_XXX

Return

True, if deletes are visible for the ResultSet type

False, if deletes are not visible for the ResultSet type

Note:  Always returns false, because updatable ResultSets are not supported.

ownInsertsAreVisible(int type)

Function: Determines if the own inserts of a ResultSet are visible.

Characteristic

Description

Syntax

public boolean ownInsertsAreVisible(int type) throws SQLException

where the type parameter is the ResultSet type, such as TYPE_XXX

Return

True, if inserts are visible for the ResultSet type

False, if inserts are not visible for the ResultSet type

Note:  Always returns false, because updatable ResultSets are not supported.

ownUpdatesAreVisible(int type)

Function: Determines if the own updates of a ResultSet are visible.

Characteristic

Description

Syntax

public boolean ownUpdatesAreVisible(int type) throws SQLException

where the type parameter is the ResultSet type, such as TYPE_XXX

Return

True, if updates are visible for the ResultSet type

False, if updates are not visible for the ResultSet type

Note:  Always returns false, because updatable ResultSets are not supported.

storesLowerCaseIdentifiers()

Function: Determines if the database treats mixed case unquoted SQL identifiers as case-insensitive and stores them in lower case.

Characteristic

Description

Syntax

public boolean storesLowerCaseIdentifiers() throws SQLException

Return

True, if the database treats mixed case unquoted SQL identifiers as case-insensitive and stores them in lower case

False, if the database does not treat mixed case unquoted SQL identifiers as case-insensitive

storesLowerCaseQuotedIdentifiers()

Function: Determines if the database treats mixed case quoted SQL identifiers as case-insensitive and stores them in lower case.

Characteristic

Description

Syntax

public boolean storesLowerCaseQuotedIdentifiers() throws SQLException

Return

True, if the database treats mixed case quoted SQL identifiers as case-insensitive and stores them in lower case

False, if the database does not treat mixed case quoted SQL identifiers as case-insensitive

storesMixedCaseIdentifiers()

Function: Determines if the database treats mixed case unquoted SQL identifiers as case-insensitive and stores them in mixed case.

Characteristic

Description

Syntax

public boolean storesMixedCaseIdentifiers() throws SQLException

Return

True, if the database treats mixed case unquoted SQL identifiers as case-insensitive and stores them in mixed case

False, if the database does not treat mixed case unquoted SQL identifiers as case-insensitive

storesMixedCaseQuotedIdentifiers()

Function: Determines if the database treats mixed case quoted SQL identifiers as case-insensitive and stores them in mixed case.

Characteristic

Description

Syntax

public boolean storesMixedCaseQuotedIdentifiers() throws SQLException

Return

True, if the database treats mixed case quoted SQL identifiers as case-insensitive and stores them in mixed case

False, if the database does not treat mixed case quoted SQL identifiers as case-insensitive

storesUpperCaseIdentifiers()

Function: Determines if the database treats mixed case unquoted SQL identifiers as case-insensitive and stores them in upper case.

Characteristic

Description

Syntax

public boolean storesUpperCaseIdentifiers() throws SQLException

Return

True, if the database treats mixed case unquoted SQL identifiers as case-insensitive and stores them in upper case

False, if the database does not treat mixed case unquoted SQL identifiers as case-insensitive

storesUpperCaseQuotedIdentifiers()

Function: Determines if the database treats mixed case quoted SQL identifiers as case-insensitive and stores them in upper case.

Characteristic

Description

Syntax

public boolean storesUpperCaseQuotedIdentifiers() throws SQLException

Return

True, if the database treats mixed case quoted SQL identifiers as case-insensitive and stores them in upper case

False, if the database does not treat mixed case quoted SQL identifiers as case-insensitive

supportsAlterTableWithAddColumn()

Function: Determines if ALTER TABLE with add column is supported.

Characteristic

Description

Syntax

public boolean supportsAlterTableWithAddColumn() throws SQLException

Return

True, if ALTER TABLE with add column is supported

False, if ALTER TABLE with add column is not supported

supportsAlterTableWithDropColumn()

Function: Determines if ALTER TABLE with drop column is supported.

Characteristic

Description

Syntax

public boolean supportsAlterTableWithDropColumn() throws SQLException

Return

True, if ALTER TABLE with drop column is supported

False, if ALTER TABLE with drop column is not supported

supportsANSI92EntryLevelSQL()

Function: Determines if the ANSI92 entry level SQL grammar is supported.

Characteristic

Description

Syntax

public boolean supportsANSI92EntryLevelSQL() throws SQLException

Return

True if the ANSI92 entry level SQL grammar is supported

Note:  All JDBC-compliant drivers must return true.

supportsANSI92FullSQL()

Function: Determines if the ANSI92 full SQL grammar is supported.

Characteristic

Description

Syntax

public boolean supportsANSI92FullSQL() throws SQLException

Return

True, if the ANSI92 full SQL grammar is supported

False, if the ANSI92 full SQL grammar is not supported

supportsANSI92IntermediateSQL()

Function: Determines if the ANSI92 intermediate SQL grammar is supported.

Characteristic

Description

Syntax

public boolean supportsANSI92IntermediateSQL() throws SQLException

Return

True, if the ANSI92 intermediate SQL grammar is supported

False, if the ANSI92 intermediate SQL grammar is not supported

supportsBatchUpdates()

Function: Determines if the driver supports batch updates.

Characteristic

Description

Syntax

public boolean supportsBatchUpdates() throws SQLException

Return

True, if the driver supports batch updates

False, if the driver does not support batch updates

supportsCatalogsInDataManipulation()

Function: Determines if a catalog name can be used in a data manipulation statement.

Characteristic

Description

Syntax

public boolean supportsCatalogsInDataManipulation() throws SQLException

Return

True, if a catalog name can be used in a data manipulation statement

False, if a catalog name cannot be used in a data manipulation statement

supportsCatalogsInIndexDefinitions()

Function: Determines if a catalog name can be used in an index definition statement.

Characteristic

Description

Syntax

public boolean supportsCatalogsInIndexDefinitions() throws SQLException

Return

True, if a catalog name can be used in an index definition statement

False, if a catalog name cannot be used in an index definition statement

supportsCatalogsInPrivilegeDefinitions()

Function: Determines if a catalog name can be used in a privilege definition statement.

Characteristic

Description

Syntax

public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException

Return

True, if a catalog name can be used in a privilege definition statement

False, if a catalog name cannot be used in a privilege definition statement

supportsCatalogsInProcedureCalls()

Function: Determines if a catalog name can be used in a procedure call statement.

Characteristic

Description

Syntax

public boolean supportsCatalogsInProcedureCalls() throws SQLException

Return

True, if a catalog name can be used in a procedure call statement

False, if a catalog name cannot be used in a procedure call statement

supportsCatalogsInTableDefinitions()

Function: Determines if a catalog name can be used in a table definition statement.

Characteristic

Description

Syntax

public boolean supportsCatalogsInTableDefinitions() throws SQLException

Return

True, if a catalog name can be used in a table definition statement

False, if a catalog name cannot be used in a table definition statement

supportsColumnAliasing()

Function: Determines if column aliasing is supported. If it is supported, the SQL AS clause can be used to provide names for computed columns or to provide alias names for columns as required.

Characteristic

Description

Syntax

public boolean supportsColumnAliasing() throws SQLException

Return

True, if column aliasing is supported

Note:  A JDBC-compliant driver always returns true.

supportsConvert()

Function: Determines if the CONVERT function between SQL types is supported.

Characteristic

Description

Syntax

public boolean supportsConvert() throws SQLException

Return

True, if the CONVERT function between SQL types is supported

False, if the CONVERT function between SQL types is not supported

supportsConvert(int fromType, int toType)

Function: Determines if the CONVERT function between SQL types is supported.

Characteristic

Description

Syntax

public boolean supportsConvert(int fromType, int toType) throws SQLException

where the parameter:

  • fromType is converted from this type
  • toType is converted to this type

Return

True, if the CONVERT function between SQL types is supported

False, if the CONVERT function between SQL types is not supported

supportsCoreSQLGrammar()

Function: Determines if the ODBC Core SQL grammar is supported.

Characteristic

Description

Syntax

public boolean supportsCoreSQLGrammar() throws SQLException

Return

True, if the ODBC core SQL grammar is supported

False, if the ODBC core SQL grammar is not supported

supportsCorrelatedSubqueries()

Function: Determines if correlated subqueries are supported.

Characteristic

Description

Syntax

public boolean supportsCorrelatedSubqueries() throws SQLException

Return

True, if correlated subqueries are supported

Note:  A JDBC-compliant driver always returns true.

supportsDataDefinitionAndDataManipulationTransactions()

Function: Determines if both data definition and data manipulation statements within a transaction are supported.

Characteristic

Description

Syntax

public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException

Return

True, if both a data definition and data manipulation statement within a transaction are supported

False, if data definition or data manipulation statements within a transaction are not supported

supportsDataManipulationTransactionsOnly()

Function: Determines if only data manipulation statements within a transaction are supported.

Characteristic

Description

Syntax

public boolean supportsDataManipulationTransactionsOnly() throws SQLException

Return

True, if only data manipulation statements within a transaction are supported

False, if only data definition statements within a transaction are also supported

supportsDifferentTableCorrelationNames()

Function: If table correlation names are supported, determines if they must be different from the names of the tables.

Characteristic

Description

Syntax

public boolean supportsDifferentTableCorrelationNames() throws SQLException

Return

True, if supported table correlation names must be different

False, if supported table correlation names need not be different

supportsExpressionsInOrderBy()

Function: Determines if expressions in ORDER BY list are supported.

Characteristic

Description

Syntax

public boolean supportsExpressionsInOrderBy() throws SQLException

Return

True, if expressions in ORDER BY lists are supported

False, if expressions in ORDER BY lists are not supported

supportsExtendedSQLGrammar()

Function: Determines if the ODBC extended SQL grammar is supported.

Characteristic

Description

Syntax

public boolean supportsExtendedSQLGrammar() throws SQLException

Return

True, if the ODBC extended SQL grammar is supported

False, if the ODBC extended SQL grammar is not supported

supportsFullOuterJoins()

Function: Determines if full nested outer joins are supported.

Characteristic

Description

Syntax

public boolean supportsFullOuterJoins() throws SQLException

Return

True, if full nested outer joins are supported

False, if full nested outer joins are not supported

supportsGetGeneratedKeys()

Function: Determines if auto-generated keys can be retrieved after a statement has been executed.

Characteristic

Description

Syntax

public boolean supportsGetGeneratedKeys() throws SQLException

Return

True, if auto-generated keys can be retrieved after a statement has been executed

False, if otherwise

supportsGroupBy()

Function: Determines if some form of GROUP BY clause is supported.

Characteristic

Description

Syntax

public boolean supportsGroupBy() throws SQLException

Return

True, if some form of GROUP BY clause is supported

False, if some form of GROUP BY clause is not supported

supportsGroupByBeyondSelect()

Function: Determines if a GROUP BY clause can add columns not in the SELECT provided it specifies all the columns in the SELECT.

Characteristic

Description

Syntax

public boolean supportsGroupByBeyondSelect() throws SQLException

Return

True, if a GROUP BY clause can add columns not in the SELECT provided it specifies all the columns in the SELECT

False, if a GROUP BY clause cannot add columns not in the SELECT

supportsGroupByUnrelated()

Function: Determines if a GROUP BY clause can use columns not in the SELECT.

Characteristic

Description

Syntax

public boolean supportsGroupByUnrelated() throws SQLException

Return

True, if a GROUP BY clause can use columns not in the SELECT

False, if a GROUP BY clause cannot use columns not in the SELECT

supportsIntegrityEnhancementFacility()

Function: Determines if the SQL Integrity Enhancement Facility is supported.

Characteristic

Description

Syntax

public boolean supportsIntegrityEnhancementFacility() throws SQLException

Return

True, if the facility is supported

False, if the facility is not supported

supportsLikeEscapeClause()

Function: Determines if the escape character in LIKE clauses is supported.

Characteristic

Description

Syntax

public boolean supportsLikeEscapeClause() throws SQLException

Return

True, if the escape character in LIKE clauses is supported

Note:  A JDBC-compliant driver always returns true.

supportsLimitedOuterJoins()

Function: Determines if there is limited support for outer joins.

Characteristic

Description

Syntax

public boolean supportsLimitedOuterJoins() throws SQLException

Return

True, if there is limited support for outer joins

False, if there is not limited support for outer joins

Note:  This will be true if supportFullOuterJoins is true.

supportsMinimumSQLGrammar()

Function: Determines if the ODBC minimum SQL grammar is supported.

Characteristic

Description

Syntax

public boolean supportsMinimumSQLGrammar() throws SQLException

Return

True, if the ODBC minimum SQL grammar is supported

False, if the ODBC minimum SQL grammar is not supported

Note:  All JDBC-compliant drivers must return true.

supportsMixedCaseIdentifiers()

Function: Determines if the database treats mixed case unquoted SQL identifiers as case-sensitive and as a result stores them in mixed case.

Characteristic

Description

Syntax

public boolean supportsMixedCaseIdentifiers() throws SQLException

Return

True, if the database treats mixed case unquoted SQL identifiers as case-sensitive and as a result stores them in mixed case

False, if the database does not treat mixed case unquoted SQL identifiers as case-sensitive

Note:  A JDBC-compliant driver will always return false.

supportsMixedCaseQuotedIdentifiers()

Function: Determines if the database treats mixed case quoted SQL identifiers as case-sensitive and as a result stores them in mixed case.

Characteristic

Description

Syntax

public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException

Return

True, if the database treats mixed case quoted SQL identifiers as case-sensitive and as a result stores them in mixed case

False, if the database does not treat mixed case quoted SQL identifiers as case-sensitive

Note:  A JDBC-compliant driver will always return false

supportsMultipleOpenResults()

Function: Determines if it is possible to have multiple ResultSet objects returned from a CallableStatement object simultaneously.

Characteristic

Description

Syntax

public boolean supportsMultipleOpenResults() throws SQLException

Return

  • True, if a CallableStatement object can return multiple ResultSet objects simultaneously
  • False, if otherwise

supportsMultipleResultSets()

Function: Determines if multiple ResultSets from a single execute are supported.

Characteristic

Description

Syntax

public boolean supportsMultipleResultSets() throws SQLException

Return

True, if multiple ResultSets from a single execute are supported

False, if multiple ResultSets from a single execute are not supported

supportsMultipleTransactions()

Function: Determines if multiple transactions can be open at once (on different connections).

Characteristic

Description

Syntax

public boolean supportsMultipleTransactions() throws SQLException

Return

True, if multiple transactions can be open at once (on different connections)

False, if multiple connections cannot be open at once (on different connections)

supportsNonNullableColumns()

Function: Determines if columns can be defined as non-nullable.

Characteristic

Description

Syntax

public boolean supportsNonNullableColumns() throws SQLException

Return

True, if columns can be defined as non-nullable.

Note:  A JDBC-compliant driver always returns true.

supportsOpenCursorsAcrossCommit()

Function: Determines if cursors can remain open across commits.

Characteristic

Description

Syntax

public boolean supportsOpenCursorsAcrossCommit() throws SQLException

Return

True, if cursors can remain open across commits

False, if cursors cannot remain open across commits

supportsOpenCursorsAcrossRollback()

Function: Determines if cursors can remain open across rollbacks.

Characteristic

Description

Syntax

public boolean supportsOpenCursorsAcrossRollback() throws SQLException

Return

True, if cursors can remain open across rollbacks

False, if cursors cannot remain open across rollbacks

supportsOpenStatementsAcrossCommit()

Function: Determines if statements remain open across commits.

Characteristic

Description

Syntax

public boolean supportsOpenStatementsAcrossCommit() throws SQLException

Return

True, if statements always remain open across commits

False, if statements might not remain open across commits

supportsOpenStatementsAcrossRollback()

Function: Determines if statements can remain open across rollbacks.

Characteristic

Description

Syntax

public boolean supportsOpenStatementsAcrossRollback() throws SQLException

Return

True, if statements always remain open across rollback

False, if statements might not remain open across rollbacks

supportsOrderByUnrelated()

Function: Determines if an ORDER BY clause can use columns not in the SELECT statement.

Characteristic

Description

Syntax

public boolean supportsOrderByUnrelated() throws SQLException

Return

True, if an ORDER BY clause can use columns not in the SELECT statement

False, if an ORDER BY clause cannot use columns not in the SELECT statement

supportsOuterJoins()

Function: Determines if some form of outer join is supported.

Characteristic

Description

Syntax

public boolean supportsOuterJoins() throws SQLException

Return

True, if some form of outer join is supported

False, if some form of outer join is not supported

supportsPositionedDelete()

Function: Determines if positioned DELETE is supported.

Characteristic

Description

Syntax

public boolean supportsPositionedDelete() throws SQLException

Return

True, if positioned DELETE is supported

False, if positioned DELETE is not supported

supportsPositionedUpdate()

Function: Determines if positioned UPDATE is supported.

Characteristic

Description

Syntax

public boolean supportsPositionedUpdate() throws SQLException

Return

True, if positioned UPDATE is supported

False, if positioned UPDATE is not supported

supportsResultSetConcurrency(int type, int concurrency)

Function: Determines if the database supports the concurrency type in combination with the given ResultSet type.

Characteristic

Description

Syntax

public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException

where the parameter:

  • type is the ResultSet type, such as TYPE_XXX
  • concurrency is the type defined in java.sql.ResultSet

Return

True, if the database supports the concurrency type in combination with the ResultSet type

False, if the database does not support the concurrency type in combination with the ResultSet type

supportsResultSetHoldability(int holdability)

Function: Retrieves whether this database supports the given result set holdability.

Characteristic

Description

Syntax

public boolean supportsResultSetHoldability(int holdability) throws SQLException

where the parameter holdability is one of the following constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT

Returns

  • True, if this database supports the given result set holdability
  • False, if this database does not support the given result set holdability

supportsResultSetType(int type)

Function: Determines if the database supports the given ResultSet type.

Characteristic

Description

Syntax

public boolean supportsResultSetType(int type) throws SQLException

where the type parameter is the ResultSet type, such as TYPE_XXX

Return

True, if the database supports the ResultSet type

False, if the database does not support the ResultSet type

supportsSchemasInDataManipulation()

Function: Determines if a schema name can be used in a data manipulation statement.

Characteristic

Description

Syntax

public boolean supportsSchemasInDataManipulation() throws SQLException

Return

True, if a schema name can be used in a data manipulation statement

False, if a schema name cannot be used in a data manipulation statement

supportsSchemasInIndexDefinitions()

Function: Determines if a schema name can be used in an index definition statement.

Characteristic

Description

Syntax

public boolean supportsSchemasInIndexDefinitions() throws SQLException

Return

True, if a schema name can be used in an index definition statement

False, if a schema name cannot be used in an index definition statement

supportsSchemasInPrivilegeDefinitions()

Function: Determines if a schema name can be used in a privilege definition statement.

Characteristic

Description

Syntax

public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException

Return

True, if a schema name can be used in a privilege definition statement

False, if a schema name cannot be used in a privilege definition statement

supportsSchemasInProcedureCalls()

Function: Determines if a schema name can be used in a procedure call statement.

Characteristic

Description

Syntax

public boolean supportsSchemasInProcedureCalls() throws SQLException

Result

True, if a schema name can be used in a procedure call

False, if a schema name cannot be used in a procedure call

supportsSchemasInTableDefinitions()

Function: Determines if a schema name can be used in a table definition statement.

Characteristic

Description

Syntax

public boolean supportsSchemasInTableDefinitions() throws SQLException

Return

True, if a schema name can be used in a table definition statement

False, if a schema name cannot be used in a table definition statement

supportsSelectForUpdate()

Function: Determines if the SELECT for UPDATE function is supported.

Characteristic

Description

Syntax

public boolean supportsSelectForUpdate() throws SQLException

Return

True, if the function is supported

False, if the function is not supported

supportsStoredProcedures()

Function: Determines if stored procedure calls using the stored procedure escape syntax are supported.

Characteristic

Description

Syntax

public boolean supportsStoredProcedures() throws SQLException

Return

True, if stored procedure calls using the stored procedure escape syntax are supported

False, if stored procedure calls using the stored procedure escape syntax are not supported

supportsSubqueriesInComparisons()

Function: Determines if subqueries in comparison expressions are supported.

Characteristic

Description

Syntax

public boolean supportsSubqueriesInComparisons() throws SQLException

Return

True, if subqueries in comparison expressions are supported

Note:  A JDBC-compliant driver always returns true.

supportsSubqueriesInExists()

Function: Determines if subqueries in exists expressions are supported.

Characteristic

Description

Syntax

public boolean supportsSubqueriesInExists() throws SQLException

Return

True, if subqueries in exists expressions are supported

Note:  A JDBC-compliant driver always returns true.

supportsSubqueriesInIns()

Function: Determines if subqueries in in statements are supported.

Characteristic

Description

Syntax

public boolean supportsSubqueriesInIns() throws SQLException

Return

True, if subqueries in in statements are supported

Note:  A JDBC-compliant driver always returns true.

supportsSubqueriesInQuantifieds()

Function: Determines if subqueries in quantified expressions are supported.

Characteristic

Description

Syntax

public boolean supportsSubqueriesInQuantifieds() throws SQLException

Return

True, if subqueries in quantified expressions are supported

Note:  A JDBC-compliant driver always returns true.

supportsTableCorrelationNames()

Function: Determines if table correlation names are supported.

Characteristic

Description

Syntax

public boolean supportsTableCorrelationNames() throws SQLException

Return

True, if table correlation names are supported

False, if table correlation names are not supported

Note:  A JDBC-compliant driver always returns true.

supportsTransactionIsolationLevel(int level)

Function: Determines if the database supports the given transaction isolation level.

Characteristic

Description

Syntax

public boolean supportsTransactionIsolationLevel(int level) throws SQLException

where the level parameter is the value defined in the java.sql.Connection method

Return

True, if the database supports the transaction level

False, if the database does not support the transaction level

supportsTransactions()

Function: Determines if transactions are supported.

Characteristic

Description

Syntax

public boolean supportsTransactions() throws SQLException

Return

True, if the database supports the transaction level

False, if the database does not support the transaction level

supportsUnion()

Function: Determines if SQL UNION is supported.

Characteristic

Description

Syntax

public boolean supportsUnion() throws SQLException

Return

True, if SQL UNION is supported

False, if SQL UNION is not supported

supportsUnionAll()

Function: Determines if SQL UNION ALL is supported.

Characteristic

Description

Syntax

public boolean supportsUnionAll() throws SQLException

Return

True, if SQL UNION ALL is supported

False, if SQL UNION ALL is not supported

updatesAreDetected(int type)

Function: Determines if a visible row update can be detected by calling the method ResultSet.rowUpdated.

Characteristic

Description

Syntax

public boolean updatesAreDetected(int type) throws SQLException

where the type parameter is the ResultSet type, such as TYPE_XXX

Return

True, if changes are detected by the ResultSet type

False, if changes are not detected by the ResultSet type

Note:  Returns False, because updatable ResultSets are not supported.

usesLocalFilePerTable()

Function: Determines if the database uses a local file for each table.

Characteristic

Description

Syntax

public boolean usesLocalFilePerTable() throws SQLException

Return

True, if the database uses a local file for each table

False, if the database does not use a local file for each table

usesLocalFiles()

Function: Determines if the database stores tables in a local file.

Characteristic

Description

Syntax

public boolean usesLocalFiles() throws SQLException

Return

True, if the database stores tables in a local file

False, if the database does not store tables in a local file

DataSource Interface

Description

A DataSource object is a factory for Connection objects. An object that implements the DataSource interface is typically registered with a JNDI service provider. A JDBC driver that is accessed using the DataSource API does not automatically register itself with the DriverManager.

Methods

Supported

getConnection()

Yes

getConnection(String username, String password)

Yes

getLoginTimeout()

Yes

getLogWriter()

Yes

setLoginTimeout(int seconds)

Yes

setLogWriter(PrintWriter out)

Yes

Methods

getConnection()

Function: Attempts to establish a database connection. The DriverManager attempts to connect to a database.

Characteristic

Description

Syntax

public Connection getConnection() throws SQLException

Return

A connection to a database data source is returned.

getConnection(String username, String password)

Function: Attempts to establish a database connection. The DriverManager attempts to select an appropriate driver from the set of registered JDBC drivers.

Characteristic

Description

Syntax

public Connection getConnection(String username, String password) throws SQLException

where the parameter:

  • username is the database user on whose behalf the Connection is being made
  • password is the user’s password

Return

A connection to the database data source is returned.

getLoginTimeout()

Function: Gets the maximum time in seconds that this data source can wait while attempting to connect to a database.

Characteristic

Description

Syntax

public int getLoginTimeout() throws SQLException

Return

DataSource login timeout value is returned.

Note:  A value of zero indicates that there is no timeout. When a DataSource object is created, the login timeout is initially zero.

See also: DataSource Method setLoginTimeout(int seconds).

getLogWriter()

Function: Gets the log writer for this data source.

Characteristic

Description

Syntax

public PrintWriter getLogWriter() throws SQLException

Return

The log writer for this data source is returned; null if logging is disabled.

Note:  The log writer is a character output stream to which all logging and tracing messages for this data source object instance will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on.

Messages printed to a data source specific log writer are not printed to the log writer associated with the java.sql.Drivermanager class. When a DataSource object is created, the log writer is initially null; in other words, logging is disabled.

See also: DataSource Method setLogWriter(PrintWriter out).

setLoginTimeout(int seconds)

Function: Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.

Characteristic

Description

Syntax

public void setLoginTimeout(int seconds) throws SQLException

where the seconds parameter is the data source login time limit.

Note:  A value of zero specifies no timeout. When a DataSource object is created, the login timeout is initially zero.

See also: DataSourceMethod getLoginTimeout().

setLogWriter(PrintWriter out)

Function: Sets the log writer for this data source.

Characteristic

Description

Syntax

public void setLogWriter(PrintWriter out) throws SQLException

where the out parameter is the new log writer; to disable logging, set to null.

Note:  The log writer is a character output stream to which all logging and tracing messages for this data source object instance will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on.

Messages printed to a data source specific log writer are not printed to the log writer associated with the java.sql.Drivermanager class. When a DataSource object is created, the log writer is initially null; in other words, logging is disabled.

See also: DataSource Method getLogWriter().

DriverManager Class

Description

The DriverManager provides a basic service for managing JDBC drivers.

A Java application loads the Teradata JDBC Driver with the following statement:

Class.forName("com.teradata.jdbc.TeraDriver");

When the DriverManager getConnection method is called, the DriverManager attempts to locate a suitable JDBC driver from among those loaded by the application.

Methods

Supported

getConnection(String url)

Yes

getConnection(String url, Properties info)

Yes

getConnection(String url, String user, String password)

Yes

getLoginTimeout()

Yes

setLoginTimeout(int seconds)

Yes

Methods

The following subsections provide a brief description of each supported DriverManager method.

getConnection(String url)

Function: Attempts to establish a connection to the given database URL.

The DriverManager attempts to select an appropriate driver from the set of registered JDBC drivers.

Characteristic

Description

Syntax

public static Connection getConnection(String url) throws SQLException

where the url parameter is a database URL of the form:

jdbc:subprotocol:subname

Return

A connection to the URL is returned.

getConnection(String url, Properties info)

Function: Attempts to establish a connection to the given database URL.

The DriverManager attempts to select an appropriate driver from the set of registered JDBC drivers.

Characteristic

Description

Syntax

public static Connection getConnection(String url, Properties info) throws SQLException

where the parameter:

  • url is a database URL of the form:

    jdbc:subprotocol:subname

  • info is a list connection argument string tag/value pairs. At a minimum, the user and password properties should be included.

Return

A connection to the URL is returned.

getConnection(String url, String user, String password)

Function: Attempts to establish a connection to the given database URL.

The DriverManager attempts to select an appropriate driver from the set of registered JDBC drivers.

Characteristic

Description

Syntax

public static Connection getConnection(String url, String user, String password) throws SQLException

where the parameter:

  • url is a database URL of the form:

    jdbc:subprotocol:subname

  • user is the database user on whose behalf the connection is being made
  • password is the password for the user

Return

A connection to the URL is returned.

getLoginTimeout()

Function: Finds the maximum time that a driver can wait to login to the database.

Characteristic

Description

Syntax

public static int getLoginTimeout()

Return

The driver login time limit in seconds is returned.

setLoginTimeout(int seconds)

Function: Sets the maximum time that a driver will wait to connect to the database.

Characteristic

Description

Syntax

public static void setLoginTimeout(int seconds)

where the seconds parameter is the time allowed to wait in seconds.