Package scriptella.jdbc
Class GenericDriver
java.lang.Object
scriptella.spi.AbstractScriptellaDriver
scriptella.jdbc.GenericDriver
- All Implemented Interfaces:
ScriptellaDriver
- Direct Known Subclasses:
Driver,Driver,Driver,Driver,Driver,Driver,Driver,Driver,Driver,Driver,Driver,Driver,Driver
Generic adapter for JDBC drivers.
- Version:
- 1.0
- Author:
- Fyodor Kupolov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnect(ConnectionParameters params) Implementor should create a new connection based on specified parameters.protected JdbcConnectionconnect(ConnectionParameters parameters, Properties props) Creates Scriptella JDBC connection.protected ConnectiongetConnection(String url, Properties props) A helper method for subclasses to avoid direct interaction with DriverManager API.protected voidloadDrivers(String... drivers) Tries to load one of the specified driver class names.Methods inherited from class scriptella.spi.AbstractScriptellaDriver
getScriptellaTitle, getScriptellaVersion, toString
-
Constructor Details
-
GenericDriver
public GenericDriver()
-
-
Method Details
-
loadDrivers
Tries to load one of the specified driver class names.- Parameters:
drivers- database driver candidate names.- Throws:
JdbcException- if no drivers were loaded
-
connect
Description copied from interface:ScriptellaDriverImplementor 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, Properties props) throws SQLException Creates Scriptella JDBC connection.- Parameters:
parameters- connection parametersprops- properties to pass to jdbc driver- Returns:
- Scriptella JDBC connection.
- Throws:
SQLException- if DB exception occurs.
-
getConnection
A helper method for subclasses to avoid direct interaction with DriverManager API.Calls
DriverManager.getConnection(String,java.util.Properties)- Throws:
SQLException
-