br.ufg.integrate.jdbc
Class DriverImpl

java.lang.Object
  extended by br.ufg.integrate.jdbc.DriverImpl
All Implemented Interfaces:
Constants, Driver

public final class DriverImpl
extends Object
implements Driver, Constants

Version:
0.1 Implementa a classe java.sql.Driver apenas para criar uma conexão temporária ("fake connection") após a primeira tentativa de conexão do cliente, para que o mesmo receba uma referência de um java.sql.Connection e possa criar os Statements. Adapted from xlSQL.
Author:
Rogerio

Field Summary
 
Fields inherited from interface br.ufg.integrate.util.Constants
DB_MAJOR_VERSION, DB_MINOR_VERSION, DRIVER_CLASS, DRIVER_MAJOR_VERSION, DRIVER_MINOR_VERSION, DRIVER_NAME, DRIVER_RELEASE, INTEGRATE_CONFIG_FILE, JDBC_COMPLIANT, JDBC_MAJOR_VERSION, JDBC_MINOR_VERSION, PRODUCT_NAME, PRODUCT_RELEASE, URL_PREFIX
 
Constructor Summary
DriverImpl()
           
 
Method Summary
 boolean acceptsURL(String url)
          Checks if a url can be servived by this driver
 Connection connect(String url, Properties info)
          Retorna uma 'falsa' conexão para que o cliente envie sua primeira consulta.
 int getMajorVersion()
          Supplies Major Version
 int getMinorVersion()
          Supplies Minor Version
 DriverPropertyInfo[] getPropertyInfo(String url, Properties info)
          Required for generic tool bakers.
 boolean jdbcCompliant()
          Supplies JDBC compliancy level (true or false)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DriverImpl

public DriverImpl()
Method Detail

acceptsURL

public boolean acceptsURL(String url)
                   throws SQLException
Checks if a url can be servived by this driver

Specified by:
acceptsURL in interface Driver
Parameters:
url - jdbc url
Returns:
true if url starts with 'jdbc:integrate:'. Example: 'jdbc:integrate:target'
Throws:
SQLException - when url is null

connect

public Connection connect(String url,
                          Properties info)
                   throws SQLException
Retorna uma 'falsa' conexão para que o cliente envie sua primeira consulta. Após o acesso ser feito à fonte de dados real pelo Wrapper, a conexão real desejada substitui esta. Para facilitar, é feita uma conexão usando a url de conexão da fonte de dados de origem (obtida do arquivo de configuração), informada na url do Integrate.

Specified by:
connect in interface Driver
Parameters:
url - JDBC url
info - não utilizada aqui
Returns:
conexão temporária
Throws:
SQLException - If the url does not contain a valid database path

getMajorVersion

public int getMajorVersion()
Supplies Major Version

Specified by:
getMajorVersion in interface Driver
Returns:
Major Version

getMinorVersion

public int getMinorVersion()
Supplies Minor Version

Specified by:
getMinorVersion in interface Driver
Returns:
Minor Version

getPropertyInfo

public DriverPropertyInfo[] getPropertyInfo(String url,
                                            Properties info)
Required for generic tool bakers.

Specified by:
getPropertyInfo in interface Driver
Parameters:
url - JDBC url
info - name of integrate configuration
Returns:
( ? )

jdbcCompliant

public boolean jdbcCompliant()
Supplies JDBC compliancy level (true or false)

Specified by:
jdbcCompliant in interface Driver
Returns:
xlSQL reports always false


Copyright © 2008 Rogério Arantes Gaioso. All Rights Reserved.