public class ConnectionFactory extends Object
| Constructor and Description |
|---|
ConnectionFactory() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Close JDBC connection (used for Spring finalization).
|
Connection |
getConnection()
Get the connection.
|
void |
init()
Open JDBC connection to the specified URL using the specified JDBC driver (used for Spring initialization).
|
void |
setDriver(String driver)
Set the driver.
|
void |
setUrl(String url)
Set the URL.
|
public void setDriver(String driver)
driver - the new JDBC driver that this factory will usepublic void setUrl(String url)
url - the new URL that this factory will connect topublic Connection getConnection()
public void init()
throws ConnectionFactoryException
ConnectionFactoryException - if any errors occurpublic void destroy()
throws ConnectionFactoryException
ConnectionFactoryException - if any errors occurCopyright © 2022. All rights reserved.