| java.lang.Object org.geotools.data.geometryless.JDBCConnectionFactory
JDBCConnectionFactory | public class JDBCConnectionFactory (Code) | | Creates ConnectionPool objects for a certain JDBC database instance.
author: Rob Atkinson rob@socialchange.net.NOSPAM.au author: Gary Sheppard garysheppard@psu.edu |
Method Summary | |
public void | free(ConnectionPool connectionPool) | public Connection | getConnection(String user, String password) 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 db. Parameters: password - the password for the user. | public Connection | getConnection(Properties props) 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. | public ConnectionPool | getConnectionPool(String username, String password) Creates and returns a JDBC ConnectionPool, or gets an existing ConnectionPool
if one exists, based upon the username and password parameters passed to this
method. | public ConnectionPool | getConnectionPool() Creates and returns a ConnectionPool, or gets an existing ConnectionPool
if one exists, based upon the username and password set in this JDBCConnectionFactory
object. | public void | setCharSet(String charSet) Sets a different character set for the postgis driver to use. | public void | setLogin(String username, String password) Sets the JDBC database login credentials. |
JDBCConnectionFactory | public JDBCConnectionFactory(String url, String driver)(Code) | | Creates a new JDBCConnectionFactory object from a specified database URL.
This is the only constructor supported since there is significant variability in implementation syntax
jdbc:mysql://:/
Parameters: url - the JDBC database URL |
getConnection | public Connection getConnection(String user, String password) throws SQLException(Code) | | 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 db. Parameters: password - the password for the user. the sql Connection object to the database. throws: SQLException - if the configured sql driver could not be found |
getConnection | public Connection getConnection(Properties props) throws SQLException(Code) | | 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. the sql Connection object to the database. throws: SQLException - if the postgis sql driver could not be found |
getConnectionPool | public ConnectionPool getConnectionPool(String username, String password) throws SQLException(Code) | | Creates and returns a JDBC ConnectionPool, or gets an existing ConnectionPool
if one exists, based upon the username and password parameters passed to this
method. This is shorthand for the following two calls:
connPool.setLogin(username, password);
connPool.getConnectionPool();
Parameters: username - the JDBC username Parameters: password - the password corresponding to username a JDBC ConnectionPool object throws: SQLException - if an error occurs connecting to the JDBC database |
getConnectionPool | public ConnectionPool getConnectionPool() throws SQLException(Code) | | Creates and returns a ConnectionPool, or gets an existing ConnectionPool
if one exists, based upon the username and password set in this JDBCConnectionFactory
object. Please call setLogin before calling this method, or use getConnectionPool(String, String)
instead.
a ConnectionPool object throws: SQLException - if an error occurs connecting to the DB |
setCharSet | public void setCharSet(String charSet)(Code) | | Sets a different character set for the postgis driver to use.
Parameters: charSet - the string of a valid charset name. |
setLogin | public void setLogin(String username, String password)(Code) | | Sets the JDBC database login credentials.
Parameters: username - the username Parameters: password - the password |
|
|