org.webdocwf.util.xml
Class XmlResultSetMetaData

java.lang.Object
  extended by org.webdocwf.util.xml.XmlResultSetMetaData
All Implemented Interfaces:
java.sql.ResultSetMetaData

public class XmlResultSetMetaData
extends java.lang.Object
implements java.sql.ResultSetMetaData

Class implements the JDBC ResultSetMetaData interface for the XmlJdbc driver.

Author:
Zoran Milakovic

Field Summary
protected  java.lang.String[] columnNames
          Names of columns
protected  java.lang.String tableName
          Name of table
 
Fields inherited from interface java.sql.ResultSetMetaData
columnNoNulls, columnNullable, columnNullableUnknown
 
Method Summary
 java.lang.String getCatalogName(int column)
          Returns the name of the catalog for the specified column.
 java.lang.String getColumnClassName(int column)
          Returns the name of the class for the specified column.
 int getColumnCount()
          Returns the number of columns in the table.
 int getColumnDisplaySize(int column)
          Returns the display column size for the specified column.
 java.lang.String getColumnLabel(int column)
          Returns the label for the specified column
 java.lang.String getColumnName(int column)
          Returns the name of the specified column
 int getColumnType(int column)
           
 java.lang.String getColumnTypeName(int column)
           
 int getPrecision(int column)
           
 int getScale(int column)
           
 java.lang.String getSchemaName(int column)
           
 java.lang.String getTableName(int column)
           
 boolean isAutoIncrement(int column)
          Gets the auto increment falg for the specfied column.
 boolean isCaseSensitive(int column)
          Returns the case sensitivity flag for the specfied column
 boolean isCurrency(int column)
          Returns the currency flag for the specified column
 boolean isDefinitelyWritable(int column)
           
 int isNullable(int column)
          Returns the nullable flag for the specfied column
 boolean isReadOnly(int column)
           
 boolean isSearchable(int column)
          Returns the searchable flag for the specified column
 boolean isSigned(int column)
          Returns the signed flag for the specfied column
 boolean isWritable(int column)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnNames

protected java.lang.String[] columnNames
Names of columns


tableName

protected java.lang.String tableName
Name of table

Method Detail

getColumnClassName

public java.lang.String getColumnClassName(int column)
                                    throws java.sql.SQLException
Returns the name of the class for the specified column. Always returns String.

Specified by:
getColumnClassName in interface java.sql.ResultSetMetaData
Parameters:
column - The column number
Returns:
The name of the class for the requested column
Throws:
java.sql.SQLException - Thrown if there was a problem

getColumnCount

public int getColumnCount()
                   throws java.sql.SQLException
Returns the number of columns in the table.

Specified by:
getColumnCount in interface java.sql.ResultSetMetaData
Returns:
The number of columns in the table
Throws:
java.sql.SQLException - Thrown if there is a a problem

getCatalogName

public java.lang.String getCatalogName(int column)
                                throws java.sql.SQLException
Returns the name of the catalog for the specified column. Returns "".

Specified by:
getCatalogName in interface java.sql.ResultSetMetaData
Parameters:
column - The column to get the catalog for
Returns:
The catalog name (always "")
Throws:
java.sql.SQLException - Thrown if there is a problem

getColumnDisplaySize

public int getColumnDisplaySize(int column)
                         throws java.sql.SQLException
Returns the display column size for the specified column. Always returns 20.

Specified by:
getColumnDisplaySize in interface java.sql.ResultSetMetaData
Parameters:
column - The column to get the size of
Returns:
The size of the requested column
Throws:
java.sql.SQLException - Thrown if there is a problem.

isAutoIncrement

public boolean isAutoIncrement(int column)
                        throws java.sql.SQLException
Gets the auto increment falg for the specfied column.

Specified by:
isAutoIncrement in interface java.sql.ResultSetMetaData
Parameters:
column - The column to get the flag for
Returns:
The autoIncrement flag (always false)
Throws:
java.sql.SQLException - Thrown if there is a problem

isCaseSensitive

public boolean isCaseSensitive(int column)
                        throws java.sql.SQLException
Returns the case sensitivity flag for the specfied column

Specified by:
isCaseSensitive in interface java.sql.ResultSetMetaData
Parameters:
column - The column to return the flag for
Returns:
The caseSensitive flag (always false)
Throws:
java.sql.SQLException - Thrown if there is a problem

isSearchable

public boolean isSearchable(int column)
                     throws java.sql.SQLException
Returns the searchable flag for the specified column

Specified by:
isSearchable in interface java.sql.ResultSetMetaData
Parameters:
column - the column to return the flag form
Returns:
The searchable flag (always false)
Throws:
java.sql.SQLException - Thrown if there is a problem

isCurrency

public boolean isCurrency(int column)
                   throws java.sql.SQLException
Returns the currency flag for the specified column

Specified by:
isCurrency in interface java.sql.ResultSetMetaData
Parameters:
column - The column to get the flag for
Returns:
The currency flag (always false)
Throws:
java.sql.SQLException - Thrown if there is a problem

isNullable

public int isNullable(int column)
               throws java.sql.SQLException
Returns the nullable flag for the specfied column

Specified by:
isNullable in interface java.sql.ResultSetMetaData
Parameters:
column - The column to return the flag for
Returns:
The nullable flag (always unknown)
Throws:
java.sql.SQLException - Thrown if there is a problem

isSigned

public boolean isSigned(int column)
                 throws java.sql.SQLException
Returns the signed flag for the specfied column

Specified by:
isSigned in interface java.sql.ResultSetMetaData
Parameters:
column - The column to return the flag for
Returns:
The signed flag (always false)
Throws:
java.sql.SQLException - Thrown if there is a problem

getColumnLabel

public java.lang.String getColumnLabel(int column)
                                throws java.sql.SQLException
Returns the label for the specified column

Specified by:
getColumnLabel in interface java.sql.ResultSetMetaData
Parameters:
column - The column to get the label for
Returns:
the label for the specified column
Throws:
java.sql.SQLException - Thrown if there is a problem

getColumnName

public java.lang.String getColumnName(int column)
                               throws java.sql.SQLException
Returns the name of the specified column

Specified by:
getColumnName in interface java.sql.ResultSetMetaData
Parameters:
column - The column to get the name of
Returns:
The name of the column
Throws:
java.sql.SQLException - Thrown if there is a problem

getSchemaName

public java.lang.String getSchemaName(int column)
                               throws java.sql.SQLException
Specified by:
getSchemaName in interface java.sql.ResultSetMetaData
Parameters:
column - is number of column
Returns:
emty string
Throws:
java.sql.SQLException

getPrecision

public int getPrecision(int column)
                 throws java.sql.SQLException
Specified by:
getPrecision in interface java.sql.ResultSetMetaData
Parameters:
column - is number of column
Returns:
0
Throws:
java.sql.SQLException

getScale

public int getScale(int column)
             throws java.sql.SQLException
Specified by:
getScale in interface java.sql.ResultSetMetaData
Parameters:
column - is number of column
Returns:
0
Throws:
java.sql.SQLException

getTableName

public java.lang.String getTableName(int column)
                              throws java.sql.SQLException
Specified by:
getTableName in interface java.sql.ResultSetMetaData
Parameters:
column - is number of column
Returns:
table name
Throws:
java.sql.SQLException

getColumnType

public int getColumnType(int column)
                  throws java.sql.SQLException
Specified by:
getColumnType in interface java.sql.ResultSetMetaData
Parameters:
column - is number of column
Returns:
VARCHAR (type of data)
Throws:
java.sql.SQLException

getColumnTypeName

public java.lang.String getColumnTypeName(int column)
                                   throws java.sql.SQLException
Specified by:
getColumnTypeName in interface java.sql.ResultSetMetaData
Parameters:
column - is number of column
Returns:
name of the class
Throws:
java.sql.SQLException

isReadOnly

public boolean isReadOnly(int column)
                   throws java.sql.SQLException
Specified by:
isReadOnly in interface java.sql.ResultSetMetaData
Parameters:
column - is number of column
Returns:
true
Throws:
java.sql.SQLException

isWritable

public boolean isWritable(int column)
                   throws java.sql.SQLException
Specified by:
isWritable in interface java.sql.ResultSetMetaData
Parameters:
column - is number of column
Returns:
false
Throws:
java.sql.SQLException

isDefinitelyWritable

public boolean isDefinitelyWritable(int column)
                             throws java.sql.SQLException
Specified by:
isDefinitelyWritable in interface java.sql.ResultSetMetaData
Parameters:
column - is number of column
Returns:
false
Throws:
java.sql.SQLException


Copyright © 2002-2007 Together - the Workgroup. All Rights Reserved.