DataSourceHelper Class

DEPRECATED No longer needed -- just use a DataSource with JdbcHelper.

com.bea.p13n.content.document
DataSourceHelper Class

public class DataSourceHelper

    extends Object

A class to help getting a connection to a document jdbc connections.

Related Topics

JdbcHelper


Hierarchy
Object
  DataSourceHelper

Field Summary

public static final Properties
jdbcProperties
The properties to give to the driver manager when getting a conection via a JDBC driver.
 

Constructor Summary

DataSourceHelper()

 

Method Summary

public static Driver
getDriver(String url, String driverCl)
Gets the driver for the specified url and driver class.
public static Driver
getDriver(String driverCl)
Get a JDBC driver for the specified driver class name.
public static String
getDriverClass(String url)
Try to determine the driver class for the specified url.
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   

Field Detail

jdbcProperties

public static final Properties jdbcProperties
The properties to give to the driver manager when getting a conection via a JDBC driver.

 

Constructor Detail

DataSourceHelper

public DataSourceHelper()
 

Method Detail

getDriver(String, String) Method

public static Driver getDriver(String url, 
                               String driverCl)
throws SQLException
Gets the driver for the specified url and driver class.

This does not use DriverManager at all.

Parameters

url
the jdbc url.
driverCl
the preferred driver class name (will use getDriverClass if null).

Returns

an instance of the driver or null on no driver for url.

Exceptions

SQLException
thrown on an error loading the driver.

getDriver(String) Method

public static Driver getDriver(String driverCl)
throws SQLException
Get a JDBC driver for the specified driver class name.

This is simply wrapper around Class.forName() that throws SQLExceptions on error.

Parameters

driverCl
the driver class name.

Returns

a driver instance.

Exceptions

SQLException
thrown on an error loading a driver.

getDriverClass(String) Method

public static String getDriverClass(String url)
Try to determine the driver class for the specified url.

This does a best guess based upon some common JDBC drivers and their URL formats. It is generally better to specify the JDBC driver class name instead.

Parameters

url
the JDBC url.

Returns

the driver to try or null on unknown url.