| java.lang.Object org.geotools.data.mysql.MySQLConnectionFactory
Constructor Summary | |
public | MySQLConnectionFactory(String url) Creates a new MySQLConnectionFactory object from a MySQL database URL. | public | MySQLConnectionFactory(String host, int port, String instance) Creates a new MySQLConnectionFactory object from a host name, port number,
and instance name. | public | MySQLConnectionFactory(String host, String instance) Creates a new MySQLConnectionFactory object from a host name and an instance
name, using the normal MySQL port number of 3306. |
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 pgsql 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 MySQL 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 MySQL ConnectionPool, or gets an existing ConnectionPool
if one exists, based upon the username and password set in this MySQLConnectionFactory
object. | public void | setLogin(String username, String password) Sets the MySQL database login credentials. |
MySQLConnectionFactory | public MySQLConnectionFactory(String url)(Code) | | Creates a new MySQLConnectionFactory object from a MySQL database URL. This
is normally of the following format:
jdbc:mysql://:/
Parameters: url - the MySQL database URL |
MySQLConnectionFactory | public MySQLConnectionFactory(String host, int port, String instance)(Code) | | Creates a new MySQLConnectionFactory object from a host name, port number,
and instance name.
Parameters: host - the MySQL database host Parameters: port - the port number for the MySQL database Parameters: instance - the MySQL database instance name |
MySQLConnectionFactory | public MySQLConnectionFactory(String host, String instance)(Code) | | Creates a new MySQLConnectionFactory object from a host name and an instance
name, using the normal MySQL port number of 3306.
Parameters: host - the MySQL database host Parameters: instance - the MySQL database instance name |
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 pgsql db. Parameters: password - the password for the user. the sql Connection object to the database. throws: SQLException - if the postgis 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 MySQL 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 MySQL username Parameters: password - the password corresponding to username a MySQL ConnectionPool object throws: SQLException - if an error occurs connecting to the MySQL database |
getConnectionPool | public ConnectionPool getConnectionPool() throws SQLException(Code) | | Creates and returns a MySQL ConnectionPool, or gets an existing ConnectionPool
if one exists, based upon the username and password set in this MySQLConnectionFactory
object. Please call setLogin before calling this method, or use getConnectionPool(String, String)
instead.
a MySQL ConnectionPool object throws: SQLException - if an error occurs connecting to the DB |
setLogin | public void setLogin(String username, String password)(Code) | | Sets the MySQL database login credentials.
Parameters: username - the username Parameters: password - the password |
|
|