com.simba.dsi.core.impl
Class DSIDriver

java.lang.Object
  extended by com.simba.dsi.core.impl.DSIDriver
All Implemented Interfaces:
IDriver

public abstract class DSIDriver
extends java.lang.Object
implements IDriver

Abstract implementation of IDriver that initializes and manages driver properties.


Field Summary
protected  DSIMessageSource m_msgSrc
          The driver-wide DSIMessageSource.
static com.simba.support.exceptions.ExceptionBuilder s_DSIMessages
          The exception builder for this driver.
 
Constructor Summary
protected DSIDriver()
          Constructs a DSIDriver with default properties.
 
Method Summary
 com.simba.support.security.ICredentialFactory createCredentialFactory()
          Creates a credential factory for integrated security (Kerberos) credentials.
 void deregister()
          Method called by DriverManager.deregisterDriver(Driver) to notify the JDBC driver that it was de-registered.
 IEventHandler getEventHandler()
          Gets the event handler interface.
 java.util.Locale getLocale()
          Gets the driver-wide locale.
 com.simba.support.IMessageSource getMessageSource()
          Gets the IMessageSource object for this driver.
 Variant getProperty(int propKey)
          Gets the driver property as identified by the given property key.
protected  void setProperty(int propKey, Variant propValue)
          Used by subclasses to override a property, as identified by the given property key, with the given property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.simba.dsi.core.interfaces.IDriver
createEnvironment, getDriverLog
 

Field Detail

s_DSIMessages

public static final com.simba.support.exceptions.ExceptionBuilder s_DSIMessages
The exception builder for this driver.


m_msgSrc

protected DSIMessageSource m_msgSrc
The driver-wide DSIMessageSource.

This message source passes in true for the two flags, which control whether the vendor name and the component name is prepended to each message.

Constructor Detail

DSIDriver

protected DSIDriver()
             throws com.simba.support.exceptions.ErrorException
Constructs a DSIDriver with default properties.

Throws:
com.simba.support.exceptions.ErrorException - If an error occurs while setting up default property values.
Method Detail

createCredentialFactory

public com.simba.support.security.ICredentialFactory createCredentialFactory()
Creates a credential factory for integrated security (Kerberos) credentials.

A new Credential Factory may be created per connection to construct new Credentials each time. This is only called if the DSI_DRIVER_SUPPORTS_INTEGRATED_SECURITY DSI Driver Property has been set.

Specified by:
createCredentialFactory in interface IDriver
Returns:
An ICredentialFactory.

getEventHandler

public IEventHandler getEventHandler()
Gets the event handler interface.

Specified by:
getEventHandler in interface IDriver
Returns:
Returns null by default.

getLocale

public java.util.Locale getLocale()
Gets the driver-wide locale.

The locale is read from SettingReader, which defaults to the JVM default locale.

The locale is composed of a 2-letter (lower case) language code, and an optional 2-letter (upper case) country code. If a country code is included, the two codes _MUST_ be separated by a hyphen (-).

The language codes conform to the ISO 639-1 standard. http://www.loc.gov/standards/iso639-2/php/code_list.php

The country codes conform to the ISO 3166-1 Alpha-2 code standard. http://www.iso.org/iso/country_codes/iso-3166-1_decoding_table.htm

Examples: en-US (English - United States) fr-CA (French - Canada) it-IT (Italian - Italy) de-DE (German - Germany) es-ES (Spanish - Spain (Traditional)) ja (Japanese)

Specified by:
getLocale in interface IDriver
Returns:
The locale for this connection.

getMessageSource

public com.simba.support.IMessageSource getMessageSource()
Gets the IMessageSource object for this driver.

Specified by:
getMessageSource in interface IDriver
Returns:
The message source associated with this driver.

getProperty

public Variant getProperty(int propKey)
                    throws BadPropertyKeyException,
                           com.simba.support.exceptions.ErrorException
Gets the driver property as identified by the given property key.

Specified by:
getProperty in interface IDriver
Parameters:
propKey - Property key associated with an driver property.
Returns:
Property value associated with the given property key.
Throws:
BadPropertyKeyException - If the property key is not found
com.simba.support.exceptions.ErrorException - If an unspecified error occurs.
See Also:
Variant

deregister

public void deregister()
Method called by DriverManager.deregisterDriver(Driver) to notify the JDBC driver that it was de-registered.

The deregister method is intended only to be used by JDBC Drivers and not by applications. JDBC drivers are recommended to not implement DriverAction in a public class. If there are active connections to the database at the time that the deregister method is called, it is implementation specific as to whether the connections are closed or allowed to continue. Once this method is called, it is implementation specific as to whether the driver may limit the ability to create new connections to the database, invoke other Driver methods or throw a SQLException.

NOTE: This method should only be implemented if using JDBC4.2 or higher because DriverAction interface with this method was introduced in Java 1.8

If this method wants to be used then the driver must be registered with JDBC42AbstractDriver

Specified by:
deregister in interface IDriver

setProperty

protected void setProperty(int propKey,
                           Variant propValue)
                    throws com.simba.support.exceptions.ErrorException
Used by subclasses to override a property, as identified by the given property key, with the given property value.

Parameters:
propKey - Property key associated with a DSI connection property.
propValue - Property value to be set on the DSI connection property associated with the given property key.
Throws:
com.simba.support.exceptions.ErrorException - If an unspecified error occurs.
See Also:
Variant


Copyright © 2006-2014 Simba Technologies Incorporated. All Rights Reserved.