Quadcap Embeddable Server

com.quadcap.services.DataSource Class Reference

Inheritance diagram for com.quadcap.services.DataSource:

Referenceable List of all members.

Detailed Description

Author:
Stan Bailes

Definition at line 60 of file DataSource.java.

Public Member Functions

 DataSource ()
 Default conctructor.

void setName (String name)
String getName ()
void setDriverClass (String s)
String getDriverClass ()
String getUrl ()
 Return the URL to which this data source is bound.

void setUrl (String url)
 Setter method for specifing this data source's URL.

void addConnectionProperty (String name, String val)
 Add a connection property for this data source.

java.sql.Connection getConnection () throws SQLException
 Get a new Connection bound to this data source.

java.sql.Connection getConnection (String username, String password) throws SQLException
 Get a new Connection bound to this data source.

PrintWriter getLogWriter ()
 Get the log writer for messages associated with this data source.

void setLogWriter (PrintWriter w)
 Set the log writer for debugging messages associated with this data source.

int getLoginTimeout ()
 Get the login timeout.

void setLoginTimeout (int timeout)
 Set the login timeout.

Reference getReference ()

Package Attributes

String name
String driverClass = null
PrintWriter logWriter = null
int loginTimeout = 0
String url
Properties props = new Properties()
Driver driver = null

Private Member Functions

final Driver getDriver () throws SQLException


Constructor & Destructor Documentation

com.quadcap.services.DataSource.DataSource  ) 
 

Default conctructor.

Definition at line 72 of file DataSource.java.


Member Function Documentation

void com.quadcap.services.DataSource.addConnectionProperty String  name,
String  val
 

Add a connection property for this data source.

Parameters:
name the connection property's name
val the connection property's value

Definition at line 113 of file DataSource.java.

References com.quadcap.services.DataSource.addConnectionProperty(), and com.quadcap.services.DataSource.props.

Referenced by com.quadcap.services.DataSource.addConnectionProperty(), and com.quadcap.services.DataSourcesParser.endElement().

java.sql.Connection com.quadcap.services.DataSource.getConnection String  username,
String  password
throws SQLException
 

Get a new Connection bound to this data source.

Parameters:
username the database user for whom the connection is being made.
password the user's password.
Returns:
a new Connection
Exceptions:
SQLException may be thrown

Definition at line 139 of file DataSource.java.

References com.quadcap.services.DataSource.getDriver(), com.quadcap.services.DataSource.props, and com.quadcap.services.DataSource.url.

java.sql.Connection com.quadcap.services.DataSource.getConnection  )  throws SQLException
 

Get a new Connection bound to this data source.

Returns:
a new Connection
Exceptions:
SQLException may be thrown

Definition at line 123 of file DataSource.java.

References com.quadcap.services.DataSource.getDriver(), com.quadcap.services.DataSource.props, and com.quadcap.services.DataSource.url.

final Driver com.quadcap.services.DataSource.getDriver  )  throws SQLException [private]
 

Definition at line 196 of file DataSource.java.

References com.quadcap.services.DataSource.driver, and com.quadcap.services.DataSource.url.

Referenced by com.quadcap.services.DataSource.getConnection().

String com.quadcap.services.DataSource.getDriverClass  ) 
 

Definition at line 91 of file DataSource.java.

References com.quadcap.services.DataSource.driverClass.

int com.quadcap.services.DataSource.getLoginTimeout  ) 
 

Get the login timeout.

Not implemented in this QED release.

Definition at line 173 of file DataSource.java.

References com.quadcap.services.DataSource.loginTimeout.

PrintWriter com.quadcap.services.DataSource.getLogWriter  ) 
 

Get the log writer for messages associated with this data source.

Definition at line 151 of file DataSource.java.

References com.quadcap.services.DataSource.logWriter.

String com.quadcap.services.DataSource.getName  ) 
 

Definition at line 79 of file DataSource.java.

References com.quadcap.services.DataSource.name.

Reference com.quadcap.services.DataSource.getReference  ) 
 

Definition at line 188 of file DataSource.java.

References com.quadcap.services.DataSource.name.

String com.quadcap.services.DataSource.getUrl  ) 
 

Return the URL to which this data source is bound.

Definition at line 98 of file DataSource.java.

References com.quadcap.services.DataSource.url.

void com.quadcap.services.DataSource.setDriverClass String  s  ) 
 

Definition at line 83 of file DataSource.java.

References com.quadcap.services.DataSource.driverClass, and com.quadcap.services.DataSource.setDriverClass().

Referenced by com.quadcap.services.DataSourcesParser.endElement(), and com.quadcap.services.DataSource.setDriverClass().

void com.quadcap.services.DataSource.setLoginTimeout int  timeout  ) 
 

Set the login timeout.

Not implemented in this QED release.

Parameters:
timeout the timeout in seconds

Definition at line 184 of file DataSource.java.

References com.quadcap.services.DataSource.setLoginTimeout().

Referenced by com.quadcap.services.DataSource.setLoginTimeout().

void com.quadcap.services.DataSource.setLogWriter PrintWriter  w  ) 
 

Set the log writer for debugging messages associated with this data source.

Note: this writer isn't used for anything in this release of QED.

Parameters:
w the writer

Definition at line 164 of file DataSource.java.

References com.quadcap.services.DataSource.setLogWriter().

Referenced by com.quadcap.services.DataSource.setLogWriter().

void com.quadcap.services.DataSource.setName String  name  ) 
 

Definition at line 75 of file DataSource.java.

References com.quadcap.services.DataSource.setName().

Referenced by com.quadcap.services.DataSourcesParser.endElement(), and com.quadcap.services.DataSource.setName().

void com.quadcap.services.DataSource.setUrl String  url  ) 
 

Setter method for specifing this data source's URL.

Definition at line 103 of file DataSource.java.

References com.quadcap.services.DataSource.setUrl().

Referenced by com.quadcap.services.DataSourcesParser.endElement(), and com.quadcap.services.DataSource.setUrl().


Member Data Documentation

Driver com.quadcap.services.DataSource.driver = null [package]
 

Definition at line 67 of file DataSource.java.

Referenced by com.quadcap.services.DataSource.getDriver().

String com.quadcap.services.DataSource.driverClass = null [package]
 

Definition at line 62 of file DataSource.java.

Referenced by com.quadcap.services.DataSource.getDriverClass(), and com.quadcap.services.DataSource.setDriverClass().

int com.quadcap.services.DataSource.loginTimeout = 0 [package]
 

Definition at line 64 of file DataSource.java.

Referenced by com.quadcap.services.DataSource.getLoginTimeout().

PrintWriter com.quadcap.services.DataSource.logWriter = null [package]
 

Definition at line 63 of file DataSource.java.

Referenced by com.quadcap.services.DataSource.getLogWriter().

String com.quadcap.services.DataSource.name [package]
 

Definition at line 61 of file DataSource.java.

Referenced by com.quadcap.services.DataSource.getName(), and com.quadcap.services.DataSource.getReference().

Properties com.quadcap.services.DataSource.props = new Properties() [package]
 

Definition at line 66 of file DataSource.java.

Referenced by com.quadcap.services.DataSource.addConnectionProperty(), and com.quadcap.services.DataSource.getConnection().

String com.quadcap.services.DataSource.url [package]
 

Definition at line 65 of file DataSource.java.

Referenced by com.quadcap.services.DataSource.getConnection(), com.quadcap.services.DataSource.getDriver(), and com.quadcap.services.DataSource.getUrl().