public class DriverManagerConnectionFactory extends java.lang.Object implements ConnectionFactory
DriverManager
-based implementation of ConnectionFactory
.Constructor and Description |
---|
DriverManagerConnectionFactory(java.lang.String connectionUri)
Constructor for DriverManagerConnectionFactory.
|
DriverManagerConnectionFactory(java.lang.String connectionUri,
java.util.Properties properties)
Constructor for DriverManagerConnectionFactory.
|
DriverManagerConnectionFactory(java.lang.String connectionUri,
java.lang.String userName,
java.lang.String userPassword)
Constructor for DriverManagerConnectionFactory.
|
Modifier and Type | Method and Description |
---|---|
java.sql.Connection |
createConnection()
Create a new
Connection in an implementation specific fashion. |
public DriverManagerConnectionFactory(java.lang.String connectionUri)
connectionUri
- a database url of the form jdbc:subprotocol:subname
public DriverManagerConnectionFactory(java.lang.String connectionUri, java.util.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(java.lang.String connectionUri, java.lang.String userName, java.lang.String userPassword)
connectionUri
- a database url of the form jdbc:subprotocol:subname
userName
- the database useruserPassword
- the user's passwordpublic java.sql.Connection createConnection() throws java.sql.SQLException
ConnectionFactory
Connection
in an implementation specific fashion.createConnection
in interface ConnectionFactory
Connection
java.sql.SQLException
- if a database error occurs creating the connectionCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.