Top Description Constructors Methods
com.mchange.v2.c3p0

public final Class DriverManagerDataSourceFactory

extends Object
Class Inheritance
Imports
java.beans.PropertyChangeEvent, java.sql.SQLException, java.util.Properties, javax.sql.DataSource

Deprecated

Use the new factories in com.mchange.v2.c3p0.DataSources. See examples.

A static factory that creates DataSources which simply forward calls to java.sql.DriverManager without any pooling or other fanciness.

The DataSources returned are Refereneable and Serializable; they should be suitable for placement in a wide variety of JNDI Naming Services.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static DataSource
create(String
a jdbc driver class that can resolve jdbcUrl.
driverClass
,
String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
,
String
a username (may be null) for authentication to the RDBMS
dfltUser
,
String
a password (may be null) for authentication to the RDBMS
dfltPassword
,
String
a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally.
refFactoryLoc
)

Creates an unpooled DataSource that users java.sql.DriverManager behind the scenes to acquire Connections.

public static DataSource
create(String
a jdbc driver class that can resolve jdbcUrl.
driverClass
,
String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
,
Properties
propertis object that should be passed to DriverManager.getConnection()
props
,
String
a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally.
refFactoryLoc
)

Creates an unpooled DataSource that users java.sql.DriverManager behind the scenes to acquire Connections.

public static DataSource
create(String
a jdbc driver class that can resolve jdbcUrl.
driverClass
,
String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
,
String
a username (may be null) for authentication to the RDBMS
dfltUser
,
String
a password (may be null) for authentication to the RDBMS
dfltPassword
)

Creates an unpooled DataSource that users java.sql.DriverManager behind the scenes to acquire Connections.

public static DataSource
create(String
a jdbc driver class that can resolve jdbcUrl.
driverClass
,
String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
)

Creates an unpooled DataSource that users java.sql.DriverManager behind the scenes to acquire Connections.

public static DataSource
create(String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
,
String
a username (may be null) for authentication to the RDBMS
dfltUser
,
String
a password (may be null) for authentication to the RDBMS
dfltPassword
)

Creates an unpooled DataSource that users java.sql.DriverManager behind the scenes to acquire Connections.

public static DataSource
create(String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
)

Creates an unpooled DataSource that users java.sql.DriverManager behind the scenes to acquire Connections.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DriverManagerDataSourceFactoryback to summary
private DriverManagerDataSourceFactory()

Method Detail

createback to summary
public static DataSource create(String driverClass, String jdbcUrl, String dfltUser, String dfltPassword, String refFactoryLoc) throws SQLException

Creates an unpooled DataSource that users java.sql.DriverManager behind the scenes to acquire Connections.

Parameters
driverClass:String

a jdbc driver class that can resolve jdbcUrl.

jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

dfltUser:String

a username (may be null) for authentication to the RDBMS

dfltPassword:String

a password (may be null) for authentication to the RDBMS

refFactoryLoc:String

a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally.

createback to summary
public static DataSource create(String driverClass, String jdbcUrl, Properties props, String refFactoryLoc) throws SQLException

Creates an unpooled DataSource that users java.sql.DriverManager behind the scenes to acquire Connections.

Parameters
driverClass:String

a jdbc driver class that can resolve jdbcUrl.

jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

props:Properties

propertis object that should be passed to DriverManager.getConnection()

refFactoryLoc:String

a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally.

createback to summary
public static DataSource create(String driverClass, String jdbcUrl, String dfltUser, String dfltPassword) throws SQLException

Creates an unpooled DataSource that users java.sql.DriverManager behind the scenes to acquire Connections.

Parameters
driverClass:String

a jdbc driver class that can resolve jdbcUrl.

jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

dfltUser:String

a username (may be null) for authentication to the RDBMS

dfltPassword:String

a password (may be null) for authentication to the RDBMS

createback to summary
public static DataSource create(String driverClass, String jdbcUrl) throws SQLException

Creates an unpooled DataSource that users java.sql.DriverManager behind the scenes to acquire Connections.

Parameters
driverClass:String

a jdbc driver class that can resolve jdbcUrl.

jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

createback to summary
public static DataSource create(String jdbcUrl, String dfltUser, String dfltPassword) throws SQLException

Creates an unpooled DataSource that users java.sql.DriverManager behind the scenes to acquire Connections.

Warning

since you do not set the driver class, the resulting DataSource will be less suitable for use via JNDI: JNDI clients will have to know the driver class and make sure themselves that it is preloaded!!!

Parameters
jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

dfltUser:String

a username (may be null) for authentication to the RDBMS

dfltPassword:String

a password (may be null) for authentication to the RDBMS

createback to summary
public static DataSource create(String jdbcUrl) throws SQLException

Creates an unpooled DataSource that users java.sql.DriverManager behind the scenes to acquire Connections.

Warning

since you do not set the driver class, the resulting DataSource will be less suitable for use via JNDI: JNDI clients will have to know the driver class and make sure themselves that it is preloaded!!!

Parameters
jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.