com.metamatrix.jdbc
Class MMDriver

java.lang.Object
  extended by com.metamatrix.jdbc.BaseDriver
      extended by com.metamatrix.jdbc.MMDriver
All Implemented Interfaces:
java.sql.Driver

public final class MMDriver
extends BaseDriver

The java.sql.DriverManager class uses this class to connect to MetaMatrix. The Driver Manager maintains a pool of MMDriver objects, which it could use to connect to MetaMatrix. The MMDriver class has a static initializer, which is used to instantiate and register itsef with java.sql.DriverManager. The DriverManager's getConnection method calls connect method on available registered drivers. The first driver to recognise the given url is used to obtain a connection.


Constructor Summary
MMDriver()
          Should be a singleton and only constructed in getInstance().
 
Method Summary
 boolean acceptsURL(java.lang.String url)
          Returns true if the driver thinks that it can open a connection to the given URL.
 java.sql.Connection connect(java.lang.String url, java.util.Properties info)
          This method tries to make a metamatrix connection to the given URL.
 java.lang.String getDriverName()
          Get's the name of the driver.
static MMDriver getInstance()
           
 int getMajorVersion()
          Get's the driver's major version number.
 int getMinorVersion()
          Get's the driver's minor version number.
 
Methods inherited from class com.metamatrix.jdbc.BaseDriver
getPropertyInfo, jdbcCompliant
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MMDriver

public MMDriver()
Should be a singleton and only constructed in getInstance().

Method Detail

getInstance

public static MMDriver getInstance()

connect

public java.sql.Connection connect(java.lang.String url,
                                   java.util.Properties info)
                            throws java.sql.SQLException
This method tries to make a metamatrix connection to the given URL. This class will return a null if this is not the right driver to connect to the given URL.

Parameters:
The - URL used to establish a connection.
Returns:
Connection object created
Throws:
java.sql.SQLException - if it is unable to establish a connection to the MetaMatrix server.

acceptsURL

public boolean acceptsURL(java.lang.String url)
                   throws java.sql.SQLException
Returns true if the driver thinks that it can open a connection to the given URL. Typically drivers will return true if they understand the subprotocol specified in the URL and false if they don't. Expected URL format is jdbc:metamatrix:subprotocol:VDB@server:port;version=1;logFile=;logLevel=;txnAutoWrap=

Parameters:
The - URL used to establish a connection.
Returns:
A boolean value indicating whether the driver understands the subprotocol.
Throws:
SQLException, - should never occur
java.sql.SQLException

getMajorVersion

public int getMajorVersion()
Get's the driver's major version number. Initially this should be 1.

Returns:
major version number of the driver.

getMinorVersion

public int getMinorVersion()
Get's the driver's minor version number. Initially this should be 0.

Returns:
major version number of the driver.

getDriverName

public java.lang.String getDriverName()
Description copied from class: BaseDriver
Get's the name of the driver.

Specified by:
getDriverName in class BaseDriver
Returns:
name of the driver
Since:
4.3
See Also:
BaseDriver.getDriverName()


Copyright © 2009. All Rights Reserved.