public class DriverManagerConnectionFactory extends java.lang.Object implements ConnectionFactory
DriverManager
-based implementation of ConnectionFactory
.Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_connectUri |
protected java.lang.String |
_passwd |
protected java.util.Properties |
_props |
protected java.lang.String |
_uname |
Constructor and Description |
---|
DriverManagerConnectionFactory(java.lang.String connectUri,
java.util.Properties props)
Constructor for DriverManagerConnectionFactory.
|
DriverManagerConnectionFactory(java.lang.String connectUri,
java.lang.String uname,
java.lang.String passwd)
Constructor for DriverManagerConnectionFactory.
|
Modifier and Type | Method and Description |
---|---|
java.sql.Connection |
createConnection()
Create a new
Connection in an
implementation specific fashion. |
protected java.lang.String _connectUri
protected java.lang.String _uname
protected java.lang.String _passwd
protected java.util.Properties _props
public DriverManagerConnectionFactory(java.lang.String connectUri, java.util.Properties props)
connectUri
- a database url of the form
jdbc:subprotocol:subname
props
- 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 connectUri, java.lang.String uname, java.lang.String passwd)
connectUri
- a database url of the form
jdbc:subprotocol:subname
uname
- the database userpasswd
- 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 connection