org.geotools.data.postgis
Class PostgisConnectionFactory

java.lang.Object
  extended by org.geotools.data.postgis.PostgisConnectionFactory

Deprecated. Use DataSource, DataSourceUtil and DataSourceFinder instead *

public class PostgisConnectionFactory
extends java.lang.Object

Shell for JDBC transactions of all types. This creates connections for the postgis datasource to make its transactions. To create a PostgisDataSource, create a PostgisConnectionFactory, then call getConnection(), and pass that connection to the PostgisDataSource constructor.

Version:
$Id: PostgisConnectionFactory.java 30669 2008-06-12 23:36:58Z acuster $
Author:
Rob Hranac, Vision for New York, Chris Holmes, TOPP

Constructor Summary
PostgisConnectionFactory(java.lang.String host, int port, java.lang.String dbName)
          Deprecated. Constructor with all internal database driver classes, driver paths and database types.
PostgisConnectionFactory(java.lang.String host, java.lang.String port, java.lang.String dbName)
          Deprecated. Constructor with all internal database driver classes, driver paths and database types.
 
Method Summary
 void free(ConnectionPool connectionPool)
          Deprecated.  
 java.sql.Connection getConnection()
          Deprecated. Creates a database connection method to initialize a given database for feature extraction using the set username and password.
 java.sql.Connection getConnection(java.util.Properties props)
          Deprecated. Creates a database connection method to initialize a given database for feature extraction with the given Properties.
 java.sql.Connection getConnection(java.lang.String user, java.lang.String password)
          Deprecated. Creates a database connection method to initialize a given database for feature extraction with the user and password params.
 ConnectionPool getConnectionPool()
          Deprecated.  
 ConnectionPool getConnectionPool(java.lang.String user, java.lang.String pass)
          Deprecated.  
 void setLogin(java.lang.String user, java.lang.String password)
          Deprecated. Creates a database connection method to initialize a given database for feature extraction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostgisConnectionFactory

public PostgisConnectionFactory(java.lang.String host,
                                java.lang.String port,
                                java.lang.String dbName)
Deprecated. 
Constructor with all internal database driver classes, driver paths and database types.

Parameters:
host - The name or ip address of the computer where the postgis database is installed.
port - The port to connect on; 5432 is generally the postgres default.
dbName - The name of the pgsql database that holds the tables of the feature types that will be used by PostgisDataSource.

PostgisConnectionFactory

public PostgisConnectionFactory(java.lang.String host,
                                int port,
                                java.lang.String dbName)
Deprecated. 
Constructor with all internal database driver classes, driver paths and database types.

Parameters:
host - The name or ip address of the computer where the postgis database is installed.
port - The port to connect on; 5432 is generally the postgres default.
dbName - The name of the pgsql database that holds the tables of the feature types that will be used by PostgisDataSource.
Method Detail

setLogin

public void setLogin(java.lang.String user,
                     java.lang.String password)
Deprecated. 
Creates a database connection method to initialize a given database for feature extraction.

Parameters:
user - the name of the user connect to connect to the pgsql db.
password - the password for the user.

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Deprecated. 
Creates a database connection method to initialize a given database for feature extraction using the set username and password.

Returns:
the sql Connection object to the database.
Throws:
java.sql.SQLException - if the postgres driver could not be found

getConnection

public java.sql.Connection getConnection(java.lang.String user,
                                         java.lang.String password)
                                  throws java.sql.SQLException
Deprecated. 
Creates a database connection method to initialize a given database for feature extraction with the user and password params.

Parameters:
user - the name of the user connect to connect to the pgsql db.
password - the password for the user.
Returns:
the sql Connection object to the database.
Throws:
java.sql.SQLException - if the postgis sql driver could not be found

getConnectionPool

public ConnectionPool getConnectionPool(java.lang.String user,
                                        java.lang.String pass)
                                 throws java.sql.SQLException
Deprecated. 
Throws:
java.sql.SQLException

getConnectionPool

public ConnectionPool getConnectionPool()
                                 throws java.sql.SQLException
Deprecated. 
Throws:
java.sql.SQLException

free

public void free(ConnectionPool connectionPool)
Deprecated. 

getConnection

public java.sql.Connection getConnection(java.util.Properties props)
                                  throws java.sql.SQLException
Deprecated. 
Creates a database connection method to initialize a given database for feature extraction with the given Properties.

Parameters:
props - Should contain at a minimum the user and password. Additional properties, such as charSet, can also be added.
Returns:
the sql Connection object to the database.
Throws:
java.sql.SQLException - if the postgis sql driver could not be found


Copyright © 1996-2010 Geotools. All Rights Reserved.