net.sourceforge.jdbcimporter.connection
Class XalanConnectionDef

java.lang.Object
  extended bynet.sourceforge.jdbcimporter.connection.XalanConnectionDef
All Implemented Interfaces:
ConnectionDef

public class XalanConnectionDef
extends java.lang.Object
implements ConnectionDef

The XalanConnectionDef class defines the attributes to use to retrieve a connection from the DriverManager and supply it to Apache Xalan for use in an XSL.

Version:
0.6
Author:
Chris Nagy

Field Summary
protected  boolean cleanupPool
          The flag indicating that the pool should be removed.
protected  boolean created
          The flag indicating that the pool was created by the connection def.
protected  java.lang.String driver
          The JDBC Driver classname.
protected  int min
          The minimum number of connections to allocate in the pool.
protected  java.lang.String name
          The name of pool.
protected  java.lang.String password
          The password.
protected  org.apache.xalan.lib.sql.ConnectionPoolManager poolManager
          The connection pool manager.
protected  java.util.Properties properties
          The properties for the connection.
protected  java.lang.String url
          The connection url.
protected  java.lang.String username
          The username.
 
Constructor Summary
XalanConnectionDef()
           
 
Method Summary
 java.sql.Connection getConnection()
          Returns the connection.
 java.lang.String getDriver()
          Returns the driver classname.
 int getMin()
          Returns the min number of connections in the pool.
 java.lang.String getName()
          Returns the name of the pool.
 java.lang.String getPassword()
          Return the password.
 java.util.Properties getProperties()
          Returns the properties.
 java.lang.String getUrl()
          Returns the connection url.
 java.lang.String getUsername()
          Returns the username.
 boolean isCleanupPool()
          Returns true if the connection def should cleanup the pool that it created.
 void releaseConnection(java.sql.Connection con)
          Releases the connection specified.
 void setCleanupPool(boolean b)
          Sets the flag the determines if the connection def should cleanup the pool that it created.
 void setDriver(java.lang.String newDriver)
          Sets the driver classname.
 void setMin(int i)
          Sets the minimum number of connections in the pool.
 void setName(java.lang.String string)
          Sets the name of the pool in Xalan.
 void setPassword(java.lang.String newPassword)
          Sets the password.
 void setProperties(java.util.Properties newProperties)
          Sets the properties.
 void setUrl(java.lang.String newUrl)
          Sets the connection url.
 void setUsername(java.lang.String newUsername)
          Sets the username.
 java.lang.String toString()
          Overrides Object.toString()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

driver

protected java.lang.String driver
The JDBC Driver classname.


url

protected java.lang.String url
The connection url.


username

protected java.lang.String username
The username.


password

protected java.lang.String password
The password.


properties

protected java.util.Properties properties
The properties for the connection.


name

protected java.lang.String name
The name of pool.


min

protected int min
The minimum number of connections to allocate in the pool.


cleanupPool

protected boolean cleanupPool
The flag indicating that the pool should be removed.


created

protected boolean created
The flag indicating that the pool was created by the connection def.


poolManager

protected org.apache.xalan.lib.sql.ConnectionPoolManager poolManager
The connection pool manager.

Constructor Detail

XalanConnectionDef

public XalanConnectionDef()
Method Detail

getConnection

public java.sql.Connection getConnection()
Description copied from interface: ConnectionDef
Returns the connection.

Specified by:
getConnection in interface ConnectionDef
Returns:
the connection.
See Also:
ConnectionDef.getConnection()

releaseConnection

public void releaseConnection(java.sql.Connection con)
Description copied from interface: ConnectionDef
Releases the connection specified. This method is called when the import is complete and the connection is no longer needed.

Specified by:
releaseConnection in interface ConnectionDef
Parameters:
con - the connection.
See Also:
ConnectionDef.releaseConnection(java.sql.Connection)

isCleanupPool

public boolean isCleanupPool()
Returns true if the connection def should cleanup the pool that it created. If the pool existed before the connection def then it will not be cleaned up.

Returns:
whether the connection def will cleanup the connection pool

getMin

public int getMin()
Returns the min number of connections in the pool.

Returns:
minimum number of connections

getName

public java.lang.String getName()
Returns the name of the pool.

Returns:
name of pool

setCleanupPool

public void setCleanupPool(boolean b)
Sets the flag the determines if the connection def should cleanup the pool that it created. By default, the flag is true.

Parameters:
b - flag to indicate that the connection def should cleanup the connection pool

setMin

public void setMin(int i)
Sets the minimum number of connections in the pool. This should be greater than 1. By default, the pool size is 2.

Parameters:
i - minimum number of connections

setName

public void setName(java.lang.String string)
Sets the name of the pool in Xalan.

Parameters:
string - the name of the pool

setDriver

public void setDriver(java.lang.String newDriver)
Sets the driver classname.

Parameters:
newDriver - the driver classname.

getDriver

public java.lang.String getDriver()
Returns the driver classname.

Returns:
the driver classname

setUrl

public void setUrl(java.lang.String newUrl)
Sets the connection url.

Parameters:
newUrl - the connection url

getUrl

public java.lang.String getUrl()
Returns the connection url.

Returns:
the connection url

setUsername

public void setUsername(java.lang.String newUsername)
Sets the username.

Parameters:
newUsername - the username

getUsername

public java.lang.String getUsername()
Returns the username.

Returns:
the username

setPassword

public void setPassword(java.lang.String newPassword)
Sets the password.

Parameters:
newPassword - the password

getPassword

public java.lang.String getPassword()
Return the password.

Returns:
the password

setProperties

public void setProperties(java.util.Properties newProperties)
Sets the properties.

Parameters:
newProperties - the properties

getProperties

public java.util.Properties getProperties()
Returns the properties.

Returns:
the properties

toString

public java.lang.String toString()
Overrides Object.toString()