scriptella.jdbc
Class GenericDriver

java.lang.Object
  extended by scriptella.spi.AbstractScriptellaDriver
      extended by scriptella.jdbc.GenericDriver
All Implemented Interfaces:
ScriptellaDriver

public class GenericDriver
extends AbstractScriptellaDriver

Generic adapter for JDBC drivers.

Version:
1.0
Author:
Fyodor Kupolov

Constructor Summary
GenericDriver()
           
 
Method Summary
 JdbcConnection connect(ConnectionParameters params)
          Implementor should create a new connection based on specified parameters.
protected  JdbcConnection connect(ConnectionParameters parameters, java.util.Properties props)
          Creates Scriptella JDBC connection.
protected  java.sql.Connection getConnection(java.lang.String url, java.util.Properties props)
          A helper method for subclasses to avoid direct interaction with DriverManager API.
protected  void loadDrivers(java.lang.String... drivers)
          Tries to load one of the specified driver class names.
 
Methods inherited from class scriptella.spi.AbstractScriptellaDriver
getScriptellaTitle, getScriptellaVersion, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenericDriver

public GenericDriver()
Method Detail

loadDrivers

protected void loadDrivers(java.lang.String... drivers)
Tries to load one of the specified driver class names.

Parameters:
drivers - database driver candidate names.
Throws:
JdbcException - if no drivers were loaded

connect

public JdbcConnection connect(ConnectionParameters params)
Description copied from interface: ScriptellaDriver
Implementor should create a new connection based on specified parameters.

Parameters:
params - connection parameters defined in <connection> element.
Returns:
new connection.

connect

protected JdbcConnection connect(ConnectionParameters parameters,
                                 java.util.Properties props)
                          throws java.sql.SQLException
Creates Scriptella JDBC connection.

Parameters:
parameters - connection parameters
props - properties to pass to jdbc driver
Returns:
Scriptella JDBC connection.
Throws:
java.sql.SQLException - if DB exception occurs.

getConnection

protected java.sql.Connection getConnection(java.lang.String url,
                                            java.util.Properties props)
                                     throws java.sql.SQLException
A helper method for subclasses to avoid direct interaction with DriverManager API.

Calls DriverManager.getConnection(String,java.util.Properties)

Throws:
java.sql.SQLException


Copyright © Copyright 2006-2009 The Scriptella Project Team.