org.teiid.jdbc
Class TeiidDriver

java.lang.Object
  extended by org.teiid.jdbc.TeiidDriver
All Implemented Interfaces:
java.sql.Driver
Direct Known Subclasses:
EmbeddedDriver

public class TeiidDriver
extends java.lang.Object
implements java.sql.Driver

JDBC Driver class for Teiid Embedded and Teiid Server. This class automatically registers with the DriverManager The accepted URL format for the connection

The user, password properties are needed if the user authentication is turned on. All the "other-properties" are simple name value pairs. Look at MMJDBCURL KNOWN_PROPERTIES for list of known properties allowed.


Constructor Summary
TeiidDriver()
          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 connection to the given URL.
 java.lang.String getDriverName()
           
static TeiidDriver getInstance()
           
 int getMajorVersion()
          Get's the driver's major version number.
 int getMinorVersion()
          Get's the driver's minor version number.
 java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info)
           
 boolean jdbcCompliant()
          This method returns true if the driver passes jdbc compliance tests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TeiidDriver

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

Method Detail

getInstance

public static TeiidDriver 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 connection to the given URL. This class will return a null if this is not the right driver to connect to the given URL.

Specified by:
connect in interface java.sql.Driver
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. Expected URL format for server mode is jdbc:teiid::VDB@mm://server:port;version=1;user=username;password=password

Specified by:
acceptsURL in interface java.sql.Driver
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.

Specified by:
getMajorVersion in interface java.sql.Driver
Returns:
major version number of the driver.

getMinorVersion

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

Specified by:
getMinorVersion in interface java.sql.Driver
Returns:
major version number of the driver.

getDriverName

public java.lang.String getDriverName()

getPropertyInfo

public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url,
                                                     java.util.Properties info)
                                              throws java.sql.SQLException
Specified by:
getPropertyInfo in interface java.sql.Driver
Throws:
java.sql.SQLException

jdbcCompliant

public boolean jdbcCompliant()
This method returns true if the driver passes jdbc compliance tests.

Specified by:
jdbcCompliant in interface java.sql.Driver
Returns:
true if the driver is jdbc complaint, else false.


Copyright © 2009. All Rights Reserved.