|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.mysql.MySQLConnectionFactory
Creates ConnectionPool objects for a certain MySQL database instance.
Constructor Summary | |
MySQLConnectionFactory(java.lang.String url)
Creates a new MySQLConnectionFactory object from a MySQL database URL. |
|
MySQLConnectionFactory(java.lang.String host,
int port,
java.lang.String instance)
Creates a new MySQLConnectionFactory object from a host name, port number, and instance name. |
|
MySQLConnectionFactory(java.lang.String host,
java.lang.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 | |
void |
free(ConnectionPool connectionPool)
|
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()
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. |
ConnectionPool |
getConnectionPool(java.lang.String username,
java.lang.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. |
void |
setLogin(java.lang.String username,
java.lang.String password)
Sets the MySQL database login credentials. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MySQLConnectionFactory(java.lang.String url)
url
- the MySQL database URLpublic MySQLConnectionFactory(java.lang.String host, int port, java.lang.String instance)
host
- the MySQL database hostport
- the port number for the MySQL databaseinstance
- the MySQL database instance namepublic MySQLConnectionFactory(java.lang.String host, java.lang.String instance)
host
- the MySQL database hostinstance
- the MySQL database instance nameMethod Detail |
public ConnectionPool getConnectionPool(java.lang.String username, java.lang.String password) throws java.sql.SQLException
username
- the MySQL usernamepassword
- the password corresponding to username
java.sql.SQLException
- if an error occurs connecting to the MySQL databasepublic 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 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 foundpublic ConnectionPool getConnectionPool() throws java.sql.SQLException
java.sql.SQLException
- if an error occurs connecting to the DBpublic void setLogin(java.lang.String username, java.lang.String password)
username
- the usernamepassword
- the passwordpublic void free(ConnectionPool connectionPool)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |