org.geotools.data.db2
Class DB2ConnectionFactory

java.lang.Object
  extended byorg.geotools.data.db2.DB2ConnectionFactory

public class DB2ConnectionFactory
extends java.lang.Object

A factory to create a DB2 Connection based on the needed parameters.

Author:
David Adler - IBM Corporation

Constructor Summary
DB2ConnectionFactory(java.lang.String host, java.lang.String portnum, java.lang.String dbname)
          Creates a new DB2ConnectionFactory from a host name, port number, and database name.
 
Method Summary
 ConnectionPool getConnectionPool()
          Returns a ConnectionPool.
 java.lang.String getDbURL()
          Returns the database URL string for this connection.
 void setLogin(java.lang.String user, java.lang.String pw)
          Sets database login information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DB2ConnectionFactory

public DB2ConnectionFactory(java.lang.String host,
                            java.lang.String portnum,
                            java.lang.String dbname)
Creates a new DB2ConnectionFactory from a host name, port number, and database name.

Parameters:
host - the DB2 host name
portnum - the TCP/IP port number for the DB2 client connection
dbname - the DB2 database name
Method Detail

setLogin

public void setLogin(java.lang.String user,
                     java.lang.String pw)
Sets database login information.

Parameters:
user - the database user name
pw - the user's database password

getDbURL

public java.lang.String getDbURL()
Returns the database URL string for this connection.

Returns:
dbURL

getConnectionPool

public ConnectionPool getConnectionPool()
                                 throws java.sql.SQLException
Returns a ConnectionPool. Assumes that the required connection information: database name, user name and password have already been set.

Returns:
a ConnectionPool object
Throws:
java.sql.SQLException - if we fail to get a database connection


Copyright © GeoTools. All Rights Reserved.