|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.elvyx.DataSource
public class DataSource
DataSource wrapper
| Field Summary | |
|---|---|
protected java.util.Properties |
dsProperties
The driver to create connections with |
protected java.io.PrintWriter |
logWriter
Log stream |
| Constructor Summary | |
|---|---|
DataSource()
Default no-arg constructor for Serialization Load defaults |
|
| Method Summary | |
|---|---|
java.sql.Connection |
getConnection()
Creates a new connection using the already configured username and password. |
protected java.sql.Connection |
getConnection(java.util.Properties props)
Creates a connection using the specified properties. |
java.sql.Connection |
getConnection(java.lang.String userID,
java.lang.String password)
Creates a new connection with the given username and password |
int |
getLoginTimeout()
Returns the login timeout |
java.io.PrintWriter |
getLogWriter()
Returns the log writer for this data source |
javax.naming.Reference |
getReference()
Required method to support this class as a Referenceable. |
void |
setLoginTimeout(int seconds)
|
void |
setLogWriter(java.io.PrintWriter output)
Sets the log writer for this data source. |
void |
setPassword(java.lang.String pass)
Sets the password |
void |
setPort(int p)
Sets the database port. |
void |
setPortNumber(int p)
Sets the port number |
void |
setProperty(java.lang.String key,
java.lang.String value)
|
void |
setRealDriver(java.lang.String drv)
|
void |
setRealUrl(java.lang.String url)
|
void |
setUser(java.lang.String userID)
Sets the user ID. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Properties dsProperties
protected java.io.PrintWriter logWriter
| Constructor Detail |
|---|
public DataSource()
| Method Detail |
|---|
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLException - if an error occurs
public java.sql.Connection getConnection(java.lang.String userID,
java.lang.String password)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourceuserID - the user id to connect withpassword - the password to connect with
java.sql.SQLException - if an error occurs
public void setLogWriter(java.io.PrintWriter output)
throws java.sql.SQLException
setLogWriter in interface javax.sql.DataSourcejava.sql.SQLExceptionDataSource.setLogWriter(PrintWriter)public java.io.PrintWriter getLogWriter()
getLogWriter in interface javax.sql.DataSource
public void setLoginTimeout(int seconds)
throws java.sql.SQLException
setLoginTimeout in interface javax.sql.DataSourcejava.sql.SQLExceptionpublic int getLoginTimeout()
getLoginTimeout in interface javax.sql.DataSourcepublic void setPassword(java.lang.String pass)
pass - the passwordpublic void setPort(int p)
p - the portpublic void setPortNumber(int p)
p - the portsetPort(int)
public javax.naming.Reference getReference()
throws javax.naming.NamingException
Referenceable.
getReference in interface javax.naming.Referenceablejavax.naming.NamingException - if a JNDI error occurspublic void setRealUrl(java.lang.String url)
url - url to be used within driver.connectpublic void setRealDriver(java.lang.String drv)
url - url to be used within driver.connectpublic void setUser(java.lang.String userID)
userID - the User ID
protected java.sql.Connection getConnection(java.util.Properties props)
throws java.sql.SQLException
props - the properties to connect with
java.sql.SQLException - if an error occurs
public void setProperty(java.lang.String key,
java.lang.String value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||