org.dmonix.jdbc
Class DMConnectionDriver

java.lang.Object
  extended byorg.dmonix.jdbc.DMConnectionDriver
All Implemented Interfaces:
java.sql.Driver

public class DMConnectionDriver
extends java.lang.Object
implements java.sql.Driver

Provides methods to load drivers and create new database connections.
Each instance of the class can handle one database base URL.

Copyright: Copyright (c) 2003

Company: dmonix.org

Version:
1.0
Author:
Peter Nerg

Constructor Summary
DMConnectionDriver(java.lang.String driverClass, java.lang.String url, java.lang.String user, java.lang.String password, int initialSize)
          Registers a generic driver manager and creates a connection pool.
 
Method Summary
 boolean acceptsURL(java.lang.String url)
           
 void closeConnections()
          This will close and remove all connections from the pool.
 java.sql.Connection connect(java.lang.String url, java.util.Properties props)
          Gets a connection from the connection pool.
 int getMajorVersion()
          Returns the MAJOR version of the driver.
 int getMinorVersion()
          Returns the MINOR version of the driver.
 java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String str, java.util.Properties props)
          This method does nothing.
 boolean jdbcCompliant()
          The driver is not JDBC compliant
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DMConnectionDriver

public DMConnectionDriver(java.lang.String driverClass,
                          java.lang.String url,
                          java.lang.String user,
                          java.lang.String password,
                          int initialSize)
                   throws java.lang.ClassNotFoundException,
                          java.lang.InstantiationException,
                          java.lang.IllegalAccessException,
                          java.sql.SQLException
Registers a generic driver manager and creates a connection pool.
This generic driver registers it self to accept the same URL as the driver class provided. The constructor does the following:

Parameters:
driverClass -
url -
user -
password -
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.sql.SQLException
Method Detail

connect

public java.sql.Connection connect(java.lang.String url,
                                   java.util.Properties props)
                            throws java.sql.SQLException
Gets a connection from the connection pool.

Specified by:
connect in interface java.sql.Driver
Parameters:
url -
props - not used may as well be set to null
Returns:
Throws:
java.sql.SQLException

acceptsURL

public boolean acceptsURL(java.lang.String url)
                   throws java.sql.SQLException
Specified by:
acceptsURL in interface java.sql.Driver
Throws:
java.sql.SQLException

closeConnections

public void closeConnections()
This will close and remove all connections from the pool.


getMajorVersion

public int getMajorVersion()
Returns the MAJOR version of the driver.

Specified by:
getMajorVersion in interface java.sql.Driver
Returns:

getMinorVersion

public int getMinorVersion()
Returns the MINOR version of the driver.

Specified by:
getMinorVersion in interface java.sql.Driver
Returns:

getPropertyInfo

public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String str,
                                                     java.util.Properties props)
This method does nothing.
It will return a DriverPropertyInfo array of zero length.

Specified by:
getPropertyInfo in interface java.sql.Driver
Parameters:
str -
props -
Returns:

jdbcCompliant

public boolean jdbcCompliant()
The driver is not JDBC compliant

Specified by:
jdbcCompliant in interface java.sql.Driver
Returns:
false


Copyright © 1998-2005 dmonix.org Peter Nerg, All Rights Reserved.