Package org.teiid.jdbc
Class TeiidDriver
- java.lang.Object
-
- org.teiid.jdbc.TeiidDriver
-
- All Implemented Interfaces:
Driver
public class TeiidDriver extends Object implements Driver
JDBC Driver class for Teiid Embedded and Teiid Server. This class automatically registers with theDriverManager
The accepted URL format for the connection- Server/socket connection: jdbc:teiid:<vdb-name>@mm[s]://<server-name>:<port>;[user=<user-name>][password=<user-password>][other-properties]*
- Embedded connection: jdbc:teiid:<vdb-name>@<file-path-to-deploy.properties>;[user=<user-name>][password=<user-password>][other-properties]*
JDBCURL
KNOWN_PROPERTIES for list of known properties allowed.
-
-
Constructor Summary
Constructors Constructor Description TeiidDriver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptsURL(String url)
Returns true if the driver thinks that it can open a connection to the given URL.ConnectionImpl
connect(String url, Properties info)
String
getDriverName()
static TeiidDriver
getInstance()
int
getMajorVersion()
int
getMinorVersion()
Logger
getParentLogger()
DriverPropertyInfo[]
getPropertyInfo(String url, Properties info)
boolean
jdbcCompliant()
This method returns true if the driver passes jdbc compliance tests.protected static void
parseURL(String url, Properties info)
This method parses the URL and adds properties to the the properties object.void
setLocalProfile(ConnectionProfile embeddedProfile)
void
setSocketProfile(ConnectionProfile socketProfile)
-
-
-
Method Detail
-
getInstance
public static TeiidDriver getInstance()
-
connect
public ConnectionImpl connect(String url, Properties info) throws SQLException
- Specified by:
connect
in interfaceDriver
- Throws:
SQLException
-
setLocalProfile
public void setLocalProfile(ConnectionProfile embeddedProfile)
-
setSocketProfile
public void setSocketProfile(ConnectionProfile socketProfile)
-
acceptsURL
public boolean acceptsURL(String url) throws 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 interfaceDriver
- Parameters:
url
- used to establish a connection.- Returns:
- A boolean value indicating whether the driver understands the subprotocol.
- Throws:
SQLException
- should never occur
-
getMajorVersion
public int getMajorVersion()
- Specified by:
getMajorVersion
in interfaceDriver
-
getMinorVersion
public int getMinorVersion()
- Specified by:
getMinorVersion
in interfaceDriver
-
getDriverName
public String getDriverName()
-
getPropertyInfo
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
- Specified by:
getPropertyInfo
in interfaceDriver
- Throws:
SQLException
-
parseURL
protected static void parseURL(String url, Properties info) throws 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:
url
- The URL needed to be parsed.info
- The properties object which is to be updated with properties in the URL.- Throws:
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 interfaceDriver
- Returns:
- true if the driver is jdbc complaint, else false.
-
getParentLogger
public Logger getParentLogger()
- Specified by:
getParentLogger
in interfaceDriver
-
-