|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.postgis.PostgisConnectionFactory
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.
Constructor Summary | |
PostgisConnectionFactory(java.lang.String host,
int port,
java.lang.String dbName)
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)
Constructor with all internal database driver classes, driver paths and database types. |
Method Summary | |
void |
free(ConnectionPool connectionPool)
|
java.sql.Connection |
getConnection()
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)
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)
Creates a database connection method to initialize a given database for feature extraction with the user and password params. |
ConnectionPool |
getConnectionPool()
|
ConnectionPool |
getConnectionPool(java.lang.String user,
java.lang.String pass)
|
void |
setLogin(java.lang.String user,
java.lang.String password)
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 |
public PostgisConnectionFactory(java.lang.String host, java.lang.String port, java.lang.String dbName)
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.public PostgisConnectionFactory(java.lang.String host, int port, java.lang.String dbName)
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 |
public void setLogin(java.lang.String user, java.lang.String password)
user
- the name of the user connect to connect to the pgsql db.password
- the password for the user.public java.sql.Connection getConnection() throws java.sql.SQLException
java.sql.SQLException
- if the postgres driver could not be foundpublic java.sql.Connection getConnection(java.lang.String user, java.lang.String password) throws java.sql.SQLException
user
- the name of the user connect to connect to the pgsql db.password
- the password for the user.
java.sql.SQLException
- if the postgis sql driver could not be foundpublic ConnectionPool getConnectionPool(java.lang.String user, java.lang.String pass) throws java.sql.SQLException
java.sql.SQLException
public ConnectionPool getConnectionPool() throws java.sql.SQLException
java.sql.SQLException
public void free(ConnectionPool connectionPool)
public java.sql.Connection getConnection(java.util.Properties props) throws java.sql.SQLException
props
- Should contain at a minimum the user and password.
Additional properties, such as charSet, can also be added.
java.sql.SQLException
- if the postgis sql driver could not be found
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |