org.apache.cayenne.dba.mysql

## Class MySQLSniffer

- java.lang.Object
- - org.apache.cayenne.dba.mysql.MySQLSniffer

- All Implemented Interfaces:
    DbAdapterDetector, DbAdapterFactory

      public class MySQLSniffer
      extends Object
      implements DbAdapterFactory, DbAdapterDetector

  Detects MySQL database from JDBC metadata.
  Since:
    1.2

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AdhocObjectFactory` | `objectFactory`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MySQLSniffer(AdhocObjectFactory objectFactory)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `DbAdapter` | `createAdapter(DatabaseMetaData md)` Returns an instance of DbAdapter if the factory detects that it knows how to handle the database.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### objectFactory

          protected AdhocObjectFactory objectFactory

  - ### Constructor Detail

    - #### MySQLSniffer

          public MySQLSniffer(AdhocObjectFactory objectFactory)

  - ### Method Detail

    - #### createAdapter

          public DbAdapter createAdapter(DatabaseMetaData md)
                                  throws SQLException

      Description copied from interface: `DbAdapterFactory`
      Returns an instance of DbAdapter if the factory detects that it knows how to handle the database. Returns null if the database is not known to the factory, thus allowing multiple factories to be chained.
      Specified by:
        `createAdapter` in interface `DbAdapterDetector`
      Specified by:
        `createAdapter` in interface `DbAdapterFactory`
      Throws:
        `SQLException`

Copyright © 2001–2018 Apache Cayenne. All rights reserved.