com.sage.accpac.sm
Class DBTableMetaData

java.lang.Object
  extended by com.sage.accpac.sm.DBTableMetaData
All Implemented Interfaces:
java.sql.ResultSetMetaData, java.sql.Wrapper

@Immutable
@ThreadSafe
public class DBTableMetaData
extends java.lang.Object

Metadata for TableMetaData. A TableMetaData contains all the low-level information about a physical ACCPAC table.

Thread safety
Immutable and therefore thread-safe

Field Summary
 
Fields inherited from interface java.sql.ResultSetMetaData
columnNoNulls, columnNullable, columnNullableUnknown
 
Method Summary
 int getA4WColumnType(int column)
          Returns an A4W type for the field
 java.lang.String getCatalogName(int column)
          Returns the same as @link #getColumnName.
protected  java.nio.charset.Charset getCharacterSet()
           
 java.lang.String getColumnClassName(int arg0)
           
 int getColumnCount()
          Returns the number of columns.
 int getColumnDisplaySize(int column)
          Get a realistic estimate of the number of characters that may need to be displayed.
 java.lang.String getColumnLabel(int column)
          Returns the same as @link #getColumnName.
 java.lang.String getColumnName(int column)
          Returns the name of the column, as returned by the lower levels.
 int getColumnType(int column)
          Returns a SQL type that is suitable for the field.
 java.lang.String getColumnTypeName(int column)
          Returns a null reference.
protected  com.sage.accpac.sm.DBField getDBFieldObject(int one_based_column_index)
          Returns the DBField object for a column.
 int getFieldLength(int column)
          Returns the size of a column
 int getPrecision(int column)
          Returns the number of digits in a decimal number and zero for other types.
 int getScale(int column)
          Returns the number of decimal places for a decimal number and zero for other types.
 java.lang.String getSchemaName(int column)
          Returns a null reference.
 java.lang.String getTableName(int column)
          Returns the table name
 boolean isAutoIncrement(int column)
          Returns false indicating that the column is not an autoincrement column.
 boolean isCaseSensitive(int column)
          Returns false indicating that the column is not case-sensitive in any way (sorting or uniqueness).
 boolean isCurrency(int column)
          Returns false indicating that the column is not a currency column.
 boolean isDefinitelyWritable(int column)
          Returns false since this is a readonly set.
 int isNullable(int column)
           
 boolean isReadOnly(int column)
           
 boolean isSearchable(int column)
           
 boolean isSigned(int column)
           
 boolean isWrapperFor(java.lang.Class<?> arg0)
           
 boolean isWritable(int arg0)
           
<T> T
unwrap(java.lang.Class<T> arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDBFieldObject

protected com.sage.accpac.sm.DBField getDBFieldObject(int one_based_column_index)
                                               throws java.sql.SQLException
Returns the DBField object for a column.

Throws:
java.sql.SQLException

getColumnCount

public int getColumnCount()
Returns the number of columns.

See Also:
ResultSetMetaData.getColumnCount()

getColumnName

public java.lang.String getColumnName(int column)
Returns the name of the column, as returned by the lower levels.

Specified by:
getColumnName in interface java.sql.ResultSetMetaData
See Also:
ResultSetMetaData.getColumnName(int)

getA4WColumnType

public int getA4WColumnType(int column)
                     throws java.sql.SQLException
Returns an A4W type for the field

Throws:
java.sql.SQLException

getFieldLength

public int getFieldLength(int column)
                   throws java.sql.SQLException
Returns the size of a column

Throws:
java.sql.SQLException

getTableName

public java.lang.String getTableName(int column)
Returns the table name

Specified by:
getTableName in interface java.sql.ResultSetMetaData
See Also:
ResultSetMetaData.getTableName(int)

getCharacterSet

protected java.nio.charset.Charset getCharacterSet()

getCatalogName

public java.lang.String getCatalogName(int column)
                                throws java.sql.SQLException
Returns the same as @link #getColumnName. We do not have access to the catalog so we return the same as getColumnName.

Specified by:
getCatalogName in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException
See Also:
ResultSetMetaData.getCatalogName(int)

getColumnClassName

public java.lang.String getColumnClassName(int arg0)
                                    throws java.sql.SQLException
Specified by:
getColumnClassName in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException

getColumnDisplaySize

public int getColumnDisplaySize(int column)
                         throws java.sql.SQLException
Get a realistic estimate of the number of characters that may need to be displayed.

Specified by:
getColumnDisplaySize in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException
See Also:
StringEncoderDecoder.getRealisticLengthLimit, ResultSetMetaData.getColumnDisplaySize(int)

getColumnLabel

public java.lang.String getColumnLabel(int column)
                                throws java.sql.SQLException
Returns the same as @link #getColumnName. We do not have access to the information so we return the same as getColumnName.

Specified by:
getColumnLabel in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException
See Also:
ResultSetMetaData.getColumnLabel(int)

getColumnType

public int getColumnType(int column)
                  throws java.sql.SQLException
Returns a SQL type that is suitable for the field.

Specified by:
getColumnType in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException
See Also:
ResultSetMetaData.getColumnType(int)

getColumnTypeName

public java.lang.String getColumnTypeName(int column)
                                   throws java.sql.SQLException
Returns a null reference. We do not have access to the catalog so we do not know what is actually at the lowest levels. Rather than throwing an exception we return a null reference.

Specified by:
getColumnTypeName in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException
See Also:
ResultSetMetaData.getColumnTypeName(int)

getPrecision

public int getPrecision(int column)
                 throws java.sql.SQLException
Returns the number of digits in a decimal number and zero for other types.

Specified by:
getPrecision in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException
See Also:
ResultSetMetaData.getPrecision(int)

getScale

public int getScale(int column)
             throws java.sql.SQLException
Returns the number of decimal places for a decimal number and zero for other types.

Specified by:
getScale in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException
See Also:
ResultSetMetaData.getScale(int)

getSchemaName

public java.lang.String getSchemaName(int column)
                               throws java.sql.SQLException
Returns a null reference. We do not have access to the catalog so we do not know the schema name. Rather than throwing an exception we return a null reference.

Specified by:
getSchemaName in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException
See Also:
ResultSetMetaData.getSchemaName(int)

isAutoIncrement

public boolean isAutoIncrement(int column)
                        throws java.sql.SQLException
Returns false indicating that the column is not an autoincrement column. Since we do not have access to the actual catalog we do not know the answer. However since this is a readonly set no updates are possible so the answer cannot really be very relevant so the safest choice is to return false.

Specified by:
isAutoIncrement in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException
See Also:
ResultSetMetaData.isAutoIncrement(int)

isCaseSensitive

public boolean isCaseSensitive(int column)
                        throws java.sql.SQLException
Returns false indicating that the column is not case-sensitive in any way (sorting or uniqueness). Since we do not have access to the actual catalog we do not know the answer. However since this is a readonly set no updates are possible so the answer cannot really be very relevant so the safest choice is to return false.

Specified by:
isCaseSensitive in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException
See Also:
ResultSetMetaData.isCaseSensitive(int)

isCurrency

public boolean isCurrency(int column)
                   throws java.sql.SQLException
Returns false indicating that the column is not a currency column. Since we do not have access to the actual catalog we do not know the answer. We have the choice of returning true or false or throwing an exception.

Specified by:
isCurrency in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException
See Also:
ResultSetMetaData.isCurrency(int)

isDefinitelyWritable

public boolean isDefinitelyWritable(int column)
                             throws java.sql.SQLException
Returns false since this is a readonly set.

Specified by:
isDefinitelyWritable in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException
See Also:
ResultSetMetaData.isDefinitelyWritable(int)

isNullable

public int isNullable(int column)
               throws java.sql.SQLException
Specified by:
isNullable in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException

isReadOnly

public boolean isReadOnly(int column)
                   throws java.sql.SQLException
Specified by:
isReadOnly in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException

isSearchable

public boolean isSearchable(int column)
                     throws java.sql.SQLException
Specified by:
isSearchable in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException

isSigned

public boolean isSigned(int column)
                 throws java.sql.SQLException
Specified by:
isSigned in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException

isWritable

public boolean isWritable(int arg0)
                   throws java.sql.SQLException
Specified by:
isWritable in interface java.sql.ResultSetMetaData
Throws:
java.sql.SQLException

isWrapperFor

public boolean isWrapperFor(java.lang.Class<?> arg0)
                     throws java.sql.SQLException
Specified by:
isWrapperFor in interface java.sql.Wrapper
Throws:
java.sql.SQLException

unwrap

public <T> T unwrap(java.lang.Class<T> arg0)
         throws java.sql.SQLException
Specified by:
unwrap in interface java.sql.Wrapper
Throws:
java.sql.SQLException


Copyright © 2010 Sage Software, Inc. All rights reserved.