Method from javax.sql.rowset.RowSetMetaDataImpl Detail: |
public String getCatalogName(int columnIndex) throws SQLException {
checkColRange(columnIndex);
String str ="";
if(colInfo[columnIndex].catName == null){
} else {
str = colInfo[columnIndex].catName;
}
return str;
}
Retrieves the catalog name of the table from which the value
in the designated column was derived. |
public String getColumnClassName(int columnIndex) throws SQLException {
String className = String.class.getName();
int sqlType = getColumnType(columnIndex);
switch (sqlType) {
case Types.NUMERIC:
case Types.DECIMAL:
className = java.math.BigDecimal.class.getName();
break;
case Types.BIT:
className = java.lang.Boolean.class.getName();
break;
case Types.TINYINT:
className = java.lang.Byte.class.getName();
break;
case Types.SMALLINT:
className = java.lang.Short.class.getName();
break;
case Types.INTEGER:
className = java.lang.Integer.class.getName();
break;
case Types.BIGINT:
className = java.lang.Long.class.getName();
break;
case Types.REAL:
className = java.lang.Float.class.getName();
break;
case Types.FLOAT:
case Types.DOUBLE:
className = java.lang.Double.class.getName();
break;
case Types.BINARY:
case Types.VARBINARY:
case Types.LONGVARBINARY:
className = "byte[]";
break;
case Types.DATE:
className = java.sql.Date.class.getName();
break;
case Types.TIME:
className = java.sql.Time.class.getName();
break;
case Types.TIMESTAMP:
className = java.sql.Timestamp.class.getName();
break;
case Types.BLOB:
className = java.sql.Blob.class.getName();
break;
case Types.CLOB:
className = java.sql.Clob.class.getName();
break;
}
return className;
}
Retrieves the fully-qualified name of the class in the Java
programming language to which a value in the designated column
will be mapped. For example, if the value is an int ,
the class name returned by this method will be
java.lang.Integer .
If the value in the designated column has a custom mapping,
this method returns the name of the class that implements
SQLData . When the method ResultSet.getObject
is called to retrieve a value from the designated column, it will
create an instance of this class or one of its subclasses. |
public int getColumnCount() throws SQLException {
return colCount;
}
Retrieves the number of columns in the RowSet object
for which this RowSetMetaDataImpl object was created. |
public int getColumnDisplaySize(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].columnDisplaySize;
}
Retrieves the normal maximum width in chars of the designated column. |
public String getColumnLabel(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].columnLabel;
}
Retrieves the the suggested column title for the designated
column for use in printouts and displays. |
public String getColumnName(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].columnName;
}
Retrieves the name of the designated column. |
public int getColumnType(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].colType;
}
Retrieves the type code (one of the java.sql.Types
constants) for the SQL type of the value stored in the
designated column. |
public String getColumnTypeName(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].colTypeName;
}
Retrieves the DBMS-specific type name for values stored in the
designated column. |
public int getPrecision(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].colPrecision;
}
Retrieves the total number of digits for values stored in
the designated column. |
public int getScale(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].colScale;
}
Retrieves the number of digits to the right of the decimal point
for values stored in the designated column. |
public String getSchemaName(int columnIndex) throws SQLException {
checkColRange(columnIndex);
String str ="";
if(colInfo[columnIndex].schemaName == null){
} else {
str = colInfo[columnIndex].schemaName;
}
return str;
}
Retrieves the schema name of the table from which the value
in the designated column was derived. |
public String getTableName(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].tableName;
}
Retrieves the name of the table from which the value
in the designated column was derived. |
public boolean isAutoIncrement(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].autoIncrement;
}
Retrieves whether a value stored in the designated column is
automatically numbered, and thus readonly. |
public boolean isCaseSensitive(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].caseSensitive;
}
Indicates whether the case of the designated column's name
matters. |
public boolean isCurrency(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].currency;
}
Indicates whether a value stored in the designated column
is a cash value. |
public boolean isDefinitelyWritable(int columnIndex) throws SQLException {
return true;
}
Indicates whether a write operation on the designated column
will definitely succeed. |
public int isNullable(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].nullable;
}
Retrieves a constant indicating whether it is possible
to store a NULL value in the designated column. |
public boolean isReadOnly(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].readOnly;
}
Indicates whether the designated column is definitely
not writable, thus readonly. |
public boolean isSearchable(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].searchable;
}
Indicates whether a value stored in the designated column
can be used in a WHERE clause. |
public boolean isSigned(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].signed;
}
Indicates whether a value stored in the designated column is
a signed number. |
public boolean isWrapperFor(Class<?> interfaces) throws SQLException {
return interfaces.isInstance(this);
}
Returns true if this either implements the interface argument or is directly or indirectly a wrapper
for an object that does. Returns false otherwise. If this implements the interface then return true,
else if this is a wrapper then return the result of recursively calling isWrapperFor on the wrapped
object. If this does not implement the interface and is not a wrapper, return false.
This method should be implemented as a low-cost operation compared to unwrap so that
callers can use this method to avoid expensive unwrap calls that may fail. If this method
returns true then calling unwrap with the same argument should succeed. |
public boolean isWritable(int columnIndex) throws SQLException {
checkColRange(columnIndex);
return colInfo[columnIndex].writable;
}
Indicates whether it is possible for a write operation on
the designated column to succeed. A return value of
true means that a write operation may or may
not succeed. |
public void setAutoIncrement(int columnIndex,
boolean property) throws SQLException {
checkColRange(columnIndex);
colInfo[columnIndex].autoIncrement = property;
}
Sets whether the designated column is automatically
numbered, thus read-only, to the given boolean
value. |
public void setCaseSensitive(int columnIndex,
boolean property) throws SQLException {
checkColRange(columnIndex);
colInfo[columnIndex].caseSensitive = property;
}
Sets whether the name of the designated column is case sensitive to
the given boolean . |
public void setCatalogName(int columnIndex,
String catalogName) throws SQLException {
checkColRange(columnIndex);
if (catalogName != null)
colInfo[columnIndex].catName = catalogName;
else
colInfo[columnIndex].catName = "";
}
Sets the catalog name of the table from which the designated
column was derived to catalogName. If catalogName
is null , the catalog name is set to an empty string. |
public void setColumnCount(int columnCount) throws SQLException {
if (columnCount < = 0) {
throw new SQLException("Invalid column count. Cannot be less " +
"or equal to zero");
}
colCount = columnCount;
// If the colCount is Integer.MAX_VALUE,
// we do not initialize the colInfo object.
// even if we try to initialize the colCount with
// colCount = Integer.MAx_VALUE-1, the colInfo
// initialization fails throwing an ERROR
// OutOfMemory Exception. So we do not initialize
// colInfo at Integer.MAX_VALUE. This is to pass TCK.
if(!(colCount == Integer.MAX_VALUE)) {
colInfo = new ColInfo[colCount + 1];
for (int i=1; i < = colCount; i++) {
colInfo[i] = new ColInfo();
}
}
}
Sets to the given number the number of columns in the RowSet
object for which this RowSetMetaDataImpl object was created. |
public void setColumnDisplaySize(int columnIndex,
int size) throws SQLException {
if (size < 0) {
throw new SQLException("Invalid column display size. Cannot be less " +
"than zero");
}
checkColRange(columnIndex);
colInfo[columnIndex].columnDisplaySize = size;
}
Sets the normal maximum number of chars in the designated column
to the given number. |
public void setColumnLabel(int columnIndex,
String label) throws SQLException {
checkColRange(columnIndex);
if (label != null) {
colInfo[columnIndex].columnLabel = label;
} else {
colInfo[columnIndex].columnLabel = "";
}
}
Sets the suggested column label for use in printouts and
displays, if any, to label. If label is
null , the column label is set to an empty string
(""). |
public void setColumnName(int columnIndex,
String columnName) throws SQLException {
checkColRange(columnIndex);
if (columnName != null) {
colInfo[columnIndex].columnName = columnName;
} else {
colInfo[columnIndex].columnName = "";
}
}
Sets the column name of the designated column to the given name. |
public void setColumnType(int columnIndex,
int SQLType) throws SQLException {
// examine java.sql.Type reflectively, loop on the fields and check
// this. Separate out into a private method
checkColType(SQLType);
checkColRange(columnIndex);
colInfo[columnIndex].colType = SQLType;
}
Sets the SQL type code for values stored in the designated column
to the given type code from the class java.sql.Types . |
public void setColumnTypeName(int columnIndex,
String typeName) throws SQLException {
checkColRange(columnIndex);
if (typeName != null) {
colInfo[columnIndex].colTypeName = typeName;
} else {
colInfo[columnIndex].colTypeName = "";
}
}
Sets the type name used by the data source for values stored in the
designated column to the given type name. |
public void setCurrency(int columnIndex,
boolean property) throws SQLException {
checkColRange(columnIndex);
colInfo[columnIndex].currency = property;
}
Sets whether a value stored in the designated column is a cash
value to the given boolean . |
public void setNullable(int columnIndex,
int property) throws SQLException {
if ((property < ResultSetMetaData.columnNoNulls) ||
property > ResultSetMetaData.columnNullableUnknown) {
throw new SQLException("Invalid nullable constant set. Must be " +
"either columnNoNulls, columnNullable or columnNullableUnknown");
}
checkColRange(columnIndex);
colInfo[columnIndex].nullable = property;
}
Sets whether a value stored in the designated column can be set
to NULL to the given constant from the interface
ResultSetMetaData . |
public void setPrecision(int columnIndex,
int precision) throws SQLException {
if (precision < 0) {
throw new SQLException("Invalid precision value. Cannot be less " +
"than zero");
}
checkColRange(columnIndex);
colInfo[columnIndex].colPrecision = precision;
}
Sets the total number of decimal digits in a value stored in the
designated column to the given number. |
public void setScale(int columnIndex,
int scale) throws SQLException {
if (scale < 0) {
throw new SQLException("Invalid scale size. Cannot be less " +
"than zero");
}
checkColRange(columnIndex);
colInfo[columnIndex].colScale = scale;
}
Sets the number of digits to the right of the decimal point in a value
stored in the designated column to the given number. |
public void setSchemaName(int columnIndex,
String schemaName) throws SQLException {
checkColRange(columnIndex);
if (schemaName != null ) {
colInfo[columnIndex].schemaName = schemaName;
} else {
colInfo[columnIndex].schemaName = "";
}
}
Sets the designated column's table's schema name, if any, to
schemaName. If schemaName is null ,
the schema name is set to an empty string (""). |
public void setSearchable(int columnIndex,
boolean property) throws SQLException {
checkColRange(columnIndex);
colInfo[columnIndex].searchable = property;
}
Sets whether a value stored in the designated column can be used
in a WHERE clause to the given boolean value. |
public void setSigned(int columnIndex,
boolean property) throws SQLException {
checkColRange(columnIndex);
colInfo[columnIndex].signed = property;
}
Sets whether a value stored in the designated column is a signed
number to the given boolean . |
public void setTableName(int columnIndex,
String tableName) throws SQLException {
checkColRange(columnIndex);
if (tableName != null) {
colInfo[columnIndex].tableName = tableName;
} else {
colInfo[columnIndex].tableName = "";
}
}
Sets the name of the table from which the designated column
was derived to the given table name. |
public T unwrap(Class<T> iface) throws SQLException {
if(isWrapperFor(iface)) {
return iface.cast(this);
} else {
throw new SQLException("unwrap failed for:"+ iface);
}
}
Returns an object that implements the given interface to allow access to non-standard methods,
or standard methods not exposed by the proxy.
The result may be either the object found to implement the interface or a proxy for that object.
If the receiver implements the interface then that is the object. If the receiver is a wrapper
and the wrapped object implements the interface then that is the object. Otherwise the object is
the result of calling unwrap recursively on the wrapped object. If the receiver is not a
wrapper and does not implement the interface, then an SQLException is thrown. |