com.mizar.persistence.jdbc.metadata
Class ColumnMetaData

java.lang.Object
  extended by com.mizar.persistence.jdbc.metadata.ColumnMetaData

public class ColumnMetaData
extends java.lang.Object


Constructor Summary
ColumnMetaData()
           
ColumnMetaData(java.sql.ResultSet rset)
           
 
Method Summary
 int getCharOctetLength()
           
 java.lang.String getColumnDef()
           
static java.util.Map<java.lang.String,ColumnMetaData> getColumnMetaData(java.sql.Connection conn, java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableName, java.lang.String columnNamePattern)
           
 java.lang.String getColumnName()
           
 int getColumnSize()
           
 int getDataType()
           
 int getDecimalDigits()
           
 java.lang.Boolean getIsAutoincrement()
           
 java.lang.Boolean getIsNullable()
           
 int getNullable()
           
 int getNumPrecRadix()
           
static java.util.List<ColumnMetaData> getOrderedList(java.util.Collection<ColumnMetaData> columnMetaData)
           
 int getOrdinalPosition()
           
 java.lang.String getRemarks()
           
 java.lang.String getScopeCatalog()
           
 java.lang.String getScopeSchema()
           
 java.lang.String getScopeTable()
           
 java.lang.Short getSourceDataType()
           
 java.lang.String getTableCat()
           
 java.lang.String getTableName()
           
 java.lang.String getTableSchem()
           
 java.lang.String getTypeName()
           
 void setCharOctetLength(int charOctetLength)
           
 void setColumnDef(java.lang.String columnDef)
           
 void setColumnName(java.lang.String columnName)
           
 void setColumnSize(int columnSize)
           
 void setDataType(int dataType)
           
 void setDecimalDigits(int decimalDigits)
           
 void setIsAutoincrement(java.lang.Boolean isAutoincrement)
           
 void setIsNullable(java.lang.Boolean isNullable)
           
 void setNullable(int nullable)
           
 void setNumPrecRadix(int numPrecRadix)
           
 void setOrdinalPosition(int ordinalPosition)
           
 void setRemarks(java.lang.String remarks)
           
 void setScopeCatalog(java.lang.String scopeCatalog)
           
 void setScopeSchema(java.lang.String scopeSchema)
           
 void setScopeTable(java.lang.String scopeTable)
           
 void setSourceDataType(java.lang.Short sourceDataType)
           
 void setTableCat(java.lang.String tableCat)
           
 void setTableName(java.lang.String tableName)
           
 void setTableSchem(java.lang.String tableSchem)
           
 void setTypeName(java.lang.String typeName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnMetaData

public ColumnMetaData()

ColumnMetaData

public ColumnMetaData(java.sql.ResultSet rset)
               throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

getColumnMetaData

public static java.util.Map<java.lang.String,ColumnMetaData> getColumnMetaData(java.sql.Connection conn,
                                                                               java.lang.String catalog,
                                                                               java.lang.String schemaPattern,
                                                                               java.lang.String tableName,
                                                                               java.lang.String columnNamePattern)
                                                                        throws java.sql.SQLException
Parameters:
conn -
catalog -
schemaPattern - the schema should be in UPPER_CASE for Oracle but not for Postgres
tableName - as the COLUMN_NAME is used as a key in the returned Map the tableName should be such that only the columns of one table are returned.
The tableName should be passed in UPPERCASE for Oracle but not for Postgres
columnNamePattern -
Returns:
a Map of column names keyed with the columnName
Throws:
java.sql.SQLException
See Also:
for detailed information on parameters and results

getOrderedList

public static java.util.List<ColumnMetaData> getOrderedList(java.util.Collection<ColumnMetaData> columnMetaData)

setTableCat

public void setTableCat(java.lang.String tableCat)

getTableCat

public java.lang.String getTableCat()

setTableSchem

public void setTableSchem(java.lang.String tableSchem)

getTableSchem

public java.lang.String getTableSchem()

setTableName

public void setTableName(java.lang.String tableName)

getTableName

public java.lang.String getTableName()

setColumnName

public void setColumnName(java.lang.String columnName)

getColumnName

public java.lang.String getColumnName()

setDataType

public void setDataType(int dataType)

getDataType

public int getDataType()

setTypeName

public void setTypeName(java.lang.String typeName)

getTypeName

public java.lang.String getTypeName()

setColumnSize

public void setColumnSize(int columnSize)

getColumnSize

public int getColumnSize()

setDecimalDigits

public void setDecimalDigits(int decimalDigits)

getDecimalDigits

public int getDecimalDigits()

setNumPrecRadix

public void setNumPrecRadix(int numPrecRadix)

getNumPrecRadix

public int getNumPrecRadix()

setNullable

public void setNullable(int nullable)

getNullable

public int getNullable()
Returns:
is NULL allowed
  • DatabaseMetaData.columnNoNulls - might not allow NULL values
  • DatabaseMetaData.columnNullable - definitely allows NULL values
  • DatabaseMetaData.columnNullableUnknown - nullability unknown

setRemarks

public void setRemarks(java.lang.String remarks)

getRemarks

public java.lang.String getRemarks()

setColumnDef

public void setColumnDef(java.lang.String columnDef)

getColumnDef

public java.lang.String getColumnDef()

setCharOctetLength

public void setCharOctetLength(int charOctetLength)

getCharOctetLength

public int getCharOctetLength()

setOrdinalPosition

public void setOrdinalPosition(int ordinalPosition)

getOrdinalPosition

public int getOrdinalPosition()

setIsNullable

public void setIsNullable(java.lang.Boolean isNullable)

getIsNullable

public java.lang.Boolean getIsNullable()

setScopeCatalog

public void setScopeCatalog(java.lang.String scopeCatalog)

getScopeCatalog

public java.lang.String getScopeCatalog()

setScopeSchema

public void setScopeSchema(java.lang.String scopeSchema)

getScopeSchema

public java.lang.String getScopeSchema()

setScopeTable

public void setScopeTable(java.lang.String scopeTable)

getScopeTable

public java.lang.String getScopeTable()

setSourceDataType

public void setSourceDataType(java.lang.Short sourceDataType)

getSourceDataType

public java.lang.Short getSourceDataType()

setIsAutoincrement

public void setIsAutoincrement(java.lang.Boolean isAutoincrement)

getIsAutoincrement

public java.lang.Boolean getIsAutoincrement()