org.dbunit.ext.mysql
Class MySqlMetadataHandler

java.lang.Object
  extended by org.dbunit.ext.mysql.MySqlMetadataHandler
All Implemented Interfaces:
IMetadataHandler

public class MySqlMetadataHandler
extends java.lang.Object
implements IMetadataHandler

Special metadata handler for MySQL.
Was introduced to fix "[ 2545095 ] Mysql FEATURE_QUALIFIED_TABLE_NAMES column SQLHelper.matches".

Since:
2.4.4
Version:
$Revision: 953 $ $Date: 2009-02-01 18:24:59 +0100 (Sun, 01 Feb 2009) $
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $

Constructor Summary
MySqlMetadataHandler()
           
 
Method Summary
 java.sql.ResultSet getColumns(java.sql.DatabaseMetaData databaseMetaData, java.lang.String schemaName, java.lang.String tableName)
          Returns the result set for an invocation of DatabaseMetaData.getColumns(String, String, String, String).
 java.lang.String getSchema(java.sql.ResultSet resultSet)
          Returns the schema name to which the table of the current result set index belongs.
 boolean matches(java.sql.ResultSet resultSet, java.lang.String schema, java.lang.String table, boolean caseSensitive)
          Checks if the given resultSet matches the given schema and table name.
 boolean matches(java.sql.ResultSet columnsResultSet, java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String column, boolean caseSensitive)
          Checks if the given resultSet matches the given schema and table name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySqlMetadataHandler

public MySqlMetadataHandler()
Method Detail

getColumns

public java.sql.ResultSet getColumns(java.sql.DatabaseMetaData databaseMetaData,
                                     java.lang.String schemaName,
                                     java.lang.String tableName)
                              throws java.sql.SQLException
Description copied from interface: IMetadataHandler
Returns the result set for an invocation of DatabaseMetaData.getColumns(String, String, String, String).

Specified by:
getColumns in interface IMetadataHandler
Parameters:
databaseMetaData - The database metadata to be used for retrieving the columns
schemaName - The schema name
tableName - The table name
Returns:
The result set containing all columns
Throws:
java.sql.SQLException

matches

public boolean matches(java.sql.ResultSet resultSet,
                       java.lang.String schema,
                       java.lang.String table,
                       boolean caseSensitive)
                throws java.sql.SQLException
Description copied from interface: IMetadataHandler
Checks if the given resultSet matches the given schema and table name. The comparison is case sensitive.

Specified by:
matches in interface IMetadataHandler
Parameters:
resultSet - A result set produced via DatabaseMetaData.getColumns(String, String, String, String)
caseSensitive - Whether or not the comparison should be case sensitive
Returns:
true if the column metadata of the given resultSet matches the given schema and table parameters.
Throws:
java.sql.SQLException
See Also:
IMetadataHandler.matches(ResultSet, String, String, String, String, boolean)

matches

public boolean matches(java.sql.ResultSet columnsResultSet,
                       java.lang.String catalog,
                       java.lang.String schema,
                       java.lang.String table,
                       java.lang.String column,
                       boolean caseSensitive)
                throws java.sql.SQLException
Description copied from interface: IMetadataHandler
Checks if the given resultSet matches the given schema and table name. The comparison is case sensitive.

Specified by:
matches in interface IMetadataHandler
Parameters:
columnsResultSet - A result set produced via DatabaseMetaData.getColumns(String, String, String, String)
catalog - The name of the catalog to check. If null it is ignored in the comparison
schema - The name of the schema to check. If null it is ignored in the comparison
table - The name of the table to check. If null it is ignored in the comparison
column - The name of the column to check. If null it is ignored in the comparison
caseSensitive - Whether or not the comparison should be case sensitive
Returns:
true if the column metadata of the given resultSet matches the given schema and table parameters.
Throws:
java.sql.SQLException

getSchema

public java.lang.String getSchema(java.sql.ResultSet resultSet)
                           throws java.sql.SQLException
Description copied from interface: IMetadataHandler
Returns the schema name to which the table of the current result set index belongs.

Specified by:
getSchema in interface IMetadataHandler
Parameters:
resultSet - The result set pointing to a valid record in the database that was returned by DatabaseMetaData.getTables(String, String, String, String[]).
Returns:
The name of the schema from the given result set
Throws:
java.sql.SQLException


Copyright © 2002-2009. All Rights Reserved.