- java.lang.Object
-
- org.postgresql.pljava.internal.TupleDesc
-
public class TupleDesc extends Object
TheTupleDesc
correspons to the internal PostgreSQLTupleDesc
.- Author:
- Thomas Hallgren
-
-
Method Summary
Modifier and Type Method Description Tuple
formTuple(Object[] values)
Creates aTuple
that is described by this descriptor and initialized with the suppliedvalues
.Class
getColumnClass(int index)
Returns the Java class of the column at indexint
getColumnIndex(String colName)
Returns the index of the column namedcolName
.String
getColumnName(int index)
Returns the name of the column atindex
.long
getNativePointer()
Return pointer to native TupleDesc structure as a long; use only while a reference to this class is live and the THREADLOCK is held.Oid
getOid(int index)
Returns OID of the column type.int
size()
Returns the number of columns in this tuple descriptor.
-
-
-
Method Detail
-
getNativePointer
public final long getNativePointer() throws SQLException
Return pointer to native TupleDesc structure as a long; use only while a reference to this class is live and the THREADLOCK is held.- Throws:
SQLException
-
getColumnName
public String getColumnName(int index) throws SQLException
Returns the name of the column atindex
.- Parameters:
index
- The one based index of the column.- Returns:
- The name of the column.
- Throws:
SQLException
- If the index is out of range for this tuple descriptor.
-
getColumnIndex
public int getColumnIndex(String colName) throws SQLException
Returns the index of the column namedcolName
.- Parameters:
colName
- The name of the column.- Returns:
- The index for column
colName
. - Throws:
SQLException
- If no column with the given name can be found in this tuple descriptor.
-
formTuple
public Tuple formTuple(Object[] values) throws SQLException
Creates aTuple
that is described by this descriptor and initialized with the suppliedvalues
.- Returns:
- The created
Tuple
. - Throws:
SQLException
- If the length of the values array does not match the size of the descriptor or if the handle of this descriptor has gone stale.
-
size
public int size()
Returns the number of columns in this tuple descriptor.
-
getColumnClass
public Class getColumnClass(int index) throws SQLException
Returns the Java class of the column at index- Throws:
SQLException
-
getOid
public Oid getOid(int index) throws SQLException
Returns OID of the column type.- Throws:
SQLException
-
-