public class DriverManagerConnectionFactory extends Object implements ConnectionFactory
DriverManager
-based implementation of ConnectionFactory
.Constructor and Description |
---|
DriverManagerConnectionFactory(String connectionUri)
Constructor for DriverManagerConnectionFactory.
|
DriverManagerConnectionFactory(String connectionUri,
Properties properties)
Constructor for DriverManagerConnectionFactory.
|
DriverManagerConnectionFactory(String connectionUri,
String userName,
String userPassword)
Constructor for DriverManagerConnectionFactory.
|
Modifier and Type | Method and Description |
---|---|
Connection |
createConnection()
Create a new
Connection in an implementation specific fashion. |
public DriverManagerConnectionFactory(String connectionUri)
connectionUri
- a database url of the form jdbc:subprotocol:subname
public DriverManagerConnectionFactory(String connectionUri, Properties properties)
connectionUri
- a database url of the form jdbc:subprotocol:subname
properties
- a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and
"password" property should be included.public DriverManagerConnectionFactory(String connectionUri, String userName, String userPassword)
connectionUri
- a database url of the form jdbc:subprotocol:subname
userName
- the database useruserPassword
- the user's passwordpublic Connection createConnection() throws SQLException
ConnectionFactory
Connection
in an implementation specific fashion.createConnection
in interface ConnectionFactory
Connection
SQLException
- if a database error occurs creating the connectionCopyright © 2001–2018 The Apache Software Foundation. All rights reserved.