org.teiid.jdbc
Class TeiidDriver

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

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 JDBCURL 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)
           
 java.lang.String getDriverName()
           
static TeiidDriver getInstance()
           
 int getMajorVersion()
           
 int getMinorVersion()
           
 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.
protected static void parseURL(java.lang.String url, java.util.Properties info)
          This method parses the URL and adds properties to the the properties object.
 void setEmbeddedProfile(ConnectionProfile embeddedProfile)
           
 
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
Specified by:
connect in interface java.sql.Driver
Throws:
java.sql.SQLException

setEmbeddedProfile

public void setEmbeddedProfile(ConnectionProfile embeddedProfile)

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

getMinorVersion

public int getMinorVersion()
Specified by:
getMinorVersion in interface java.sql.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

parseURL

protected static void parseURL(java.lang.String url,
                               java.util.Properties info)
                        throws java.sql.SQLException
This method parses the URL and adds properties to the the properties object. These include required and any optional properties specified in the URL.

Parameters:
The - URL needed to be parsed.
The - properties object which is to be updated with properties in the URL.
Throws:
java.sql.SQLException - if the URL is not in the expected format.

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 © 2011. All Rights Reserved.