com.ibm.u2.jdbcx
Class UniJDBCCoreDataSource

java.lang.Object
  |
  +--com.ibm.u2.jdbcx.UniJDBCCoreDataSource
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
UniJDBCConnectionPoolDataSource, UniJDBCDataSource

public abstract class UniJDBCCoreDataSource
extends java.lang.Object
implements java.io.Serializable

UniJDBCCoreDataSource class is the abstract class from which UniJDBCDataSource and UniJDBCConnectionPoolDataSource are extended.

See Also:
DataSource, Serialized Form

Field Summary
protected  java.util.Properties DSProperties
           
protected  com.ibm.u2.jdbc.UniJDBCMsgFactory mMsgFactory
           
protected  java.lang.String password
           
protected  java.lang.String user
           
protected  java.lang.String value
           
 
Constructor Summary
UniJDBCCoreDataSource()
          Constructor.
 
Method Summary
 void addProp(java.lang.String key, java.lang.Object value)
          Adds a property to the property list.
 java.lang.String getAccount()
          Gets the account name/path.
protected  java.lang.String getCountry()
          Gets the country for localized error message reporting.
 java.lang.String getDataSourceName()
          Gets the DataSource name.
 java.lang.String getDBMSType()
          Gets the type of the DBMS.
 java.lang.String getDescription()
          Gets the description of the DataSource.
 java.util.Properties getDsProperties()
          Returns the Properties objects in the CoreDataSource.
protected  java.lang.String getLanguage()
          Gets the language for localized error message reporting.
 int getLoginTimeout()
          Get the login timeout.
 java.io.PrintWriter getLogWriter()
          Gets the logwriter for the DataSource.
protected  com.ibm.u2.jdbc.UniJDBCMsgFactory getMsgFactory()
           
 java.lang.String getNetworkType()
          Gets the network type.
protected  java.lang.String getODBCConfigURL()
          Gets the URL for ODBC configuration file.
protected  java.lang.String getODBCDSName()
          Gets the odbc data soruce name.
 java.lang.String getPassword()
          Gets the password of the user for connecting to the database.
 java.lang.Object getProp(java.lang.String key)
          Get the value of a property from the property list.
 java.lang.String getServerHost()
          Gets the database server host name.
 int getServerPort()
          Gets the database server port number
 java.lang.String getService()
          Gets the service.
protected  java.lang.String getTraceFile()
          Gets the trace file.
protected  int getTraceLevel()
          Gets the trace-level.
 java.lang.String getUser()
          Gets the user id for connecting to the database.
 void readProperties(java.io.InputStream in)
          Reads the properties from an input stream
 void removeProperty(java.lang.String key)
          Removes the property from the DataSource property list
 void setAccount(java.lang.String account)
          Sets the account.
protected  void setCountry(java.lang.String country)
          Sets the country for localized error message reporting.
 void setDataSourceName(java.lang.String dsName)
          Sets the DataSource name.
 void setDBMSType(java.lang.String dbtype)
          Sets the type of the DBMS.
 void setDescription(java.lang.String descrip)
          Sets the description of the DataSource.
protected  void setLanguage(java.lang.String language)
          Sets the language for localized error message reporting.
 void setLoginTimeout(int seconds)
          Sets the login time out.
 void setLogWriter(java.io.PrintWriter out)
          Sets the logwriter for the DataSource.
 void setNetworkType(java.lang.String network)
          Sets the network type.
protected  void setODBCConfigURL(java.lang.String url)
          Sets the URL for odbc configuration file.
protected  void setODBCDSName(java.lang.String odsn)
          Sets the ODBC datasource name.
 void setPassword(java.lang.String passwd)
          sets the password of the user for connecting to the database.
 void setServerHost(java.lang.String hostname)
          Sets the database server host name.
 void setServerPort(int port)
          Sets the server port number.
 void setService(java.lang.String service)
          Sets the service.
protected  void setTraceFile(java.lang.String ifile)
          Sets the user id to be used to connect with this DataSource.
protected  void setTraceLevel(int level)
          Sets the trace-level
 void setUser(java.lang.String iuser)
          Sets the user id for connecting to the database.
 void writeProperties(java.io.OutputStream out)
          Writes the properties of the DataSource to an outputstream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DSProperties

protected java.util.Properties DSProperties

value

protected java.lang.String value

user

protected transient java.lang.String user

password

protected transient java.lang.String password

mMsgFactory

protected transient com.ibm.u2.jdbc.UniJDBCMsgFactory mMsgFactory
Constructor Detail

UniJDBCCoreDataSource

public UniJDBCCoreDataSource()
Constructor. Allocates an empty (i.e., no properties set) UniJDBCCoreDataSource object.
Method Detail

getLoginTimeout

public int getLoginTimeout()
Get the login timeout.
Returns:
the current timeout value.

setLoginTimeout

public void setLoginTimeout(int seconds)
Sets the login time out.
Parameters:
seconds - the timeout value.

getLogWriter

public java.io.PrintWriter getLogWriter()
Gets the logwriter for the DataSource.
Returns:
the logwriter object.

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
Sets the logwriter for the DataSource.
Parameters:
out - the logwriter.

getDsProperties

public java.util.Properties getDsProperties()
Returns the Properties objects in the CoreDataSource.
Returns:
the properties object containing all properties set for the DataSource.

addProp

public void addProp(java.lang.String key,
                    java.lang.Object value)
Adds a property to the property list.
Parameters:
key - the key for this property.
value - the value for this property.

getProp

public java.lang.Object getProp(java.lang.String key)
Get the value of a property from the property list.
Parameters:
key - the key of the property that is to be retrieved.
Returns:
the value of the property.

writeProperties

public void writeProperties(java.io.OutputStream out)
                     throws java.io.IOException
Writes the properties of the DataSource to an outputstream.
Parameters:
out - the stream to which the properties are to be written.
Throws:
java.io.IOException - when an I/O error is encountered while writing to the output stream.

readProperties

public void readProperties(java.io.InputStream in)
                    throws java.io.IOException
Reads the properties from an input stream
Parameters:
in - the inputstream from which the properties are to be read.
Throws:
java.io.IOException - when an I/O error is encountered while reading from the input stream.

removeProperty

public void removeProperty(java.lang.String key)
Removes the property from the DataSource property list
Parameters:
key - Property to be removed

getDataSourceName

public java.lang.String getDataSourceName()
Gets the DataSource name.
Returns:
the name.

setDataSourceName

public void setDataSourceName(java.lang.String dsName)
Sets the DataSource name.
Parameters:
dsName - the datasource name.

getDescription

public java.lang.String getDescription()
Gets the description of the DataSource.
Returns:
the description.

setDescription

public void setDescription(java.lang.String descrip)
Sets the description of the DataSource.
Parameters:
descrip - the description of the DataSource.

getServerHost

public java.lang.String getServerHost()
Gets the database server host name.
Returns:
the host name

setServerHost

public void setServerHost(java.lang.String hostname)
Sets the database server host name.
Parameters:
hostname - the database server host name.

getServerPort

public int getServerPort()
Gets the database server port number
Returns:
the database server port number.

setServerPort

public void setServerPort(int port)
Sets the server port number.
Parameters:
port - the database server port number.

getAccount

public java.lang.String getAccount()
Gets the account name/path.
Returns:
the account name/path.

setAccount

public void setAccount(java.lang.String account)
Sets the account.
Parameters:
account - The account name/path.

getODBCDSName

protected java.lang.String getODBCDSName()
Gets the odbc data soruce name.
Returns:
the account name/path.

setODBCDSName

protected void setODBCDSName(java.lang.String odsn)
Sets the ODBC datasource name. This method will only works with getODBCConfigURL method.
Parameters:
odsn - the datasource name in the configuration file.
See Also:
setODBCDSName(java.lang.String)

getODBCConfigURL

protected java.lang.String getODBCConfigURL()
Gets the URL for ODBC configuration file.
Returns:
the URL.

setODBCConfigURL

protected void setODBCConfigURL(java.lang.String url)
Sets the URL for odbc configuration file.
Parameters:
url - the URL.

getDBMSType

public java.lang.String getDBMSType()
Gets the type of the DBMS.
Returns:
the type of the DBMS.

setDBMSType

public void setDBMSType(java.lang.String dbtype)
Sets the type of the DBMS. The valid values are: UNIVERSE and UNIDATA.
Parameters:
dbtype - the type of the DBMS.

getNetworkType

public java.lang.String getNetworkType()
Gets the network type.
Returns:
the network type.

setNetworkType

public void setNetworkType(java.lang.String network)
Sets the network type.

getService

public java.lang.String getService()
Gets the service.
Returns:
the service.

setService

public void setService(java.lang.String service)
Sets the service.

getLanguage

protected java.lang.String getLanguage()
Gets the language for localized error message reporting.
Returns:
the language.

setLanguage

protected void setLanguage(java.lang.String language)
Sets the language for localized error message reporting.
Parameters:
language - the language.

getCountry

protected java.lang.String getCountry()
Gets the country for localized error message reporting.
Returns:
the country.

setCountry

protected void setCountry(java.lang.String country)
Sets the country for localized error message reporting.
Parameters:
country - the country.

getPassword

public java.lang.String getPassword()
Gets the password of the user for connecting to the database.
Returns:
the password.

setPassword

public void setPassword(java.lang.String passwd)
sets the password of the user for connecting to the database.
Parameters:
passwd - the password.

getUser

public java.lang.String getUser()
Gets the user id for connecting to the database.
Returns:
the user id.

setUser

public void setUser(java.lang.String iuser)
Sets the user id for connecting to the database.
Parameters:
iuser - the user id.

getTraceLevel

protected int getTraceLevel()
Gets the trace-level.
Returns:
The trace level.

setTraceLevel

protected void setTraceLevel(int level)
Sets the trace-level
Parameters:
level - The level to be set to.

getTraceFile

protected java.lang.String getTraceFile()
Gets the trace file.
Returns:
the user id.

setTraceFile

protected void setTraceFile(java.lang.String ifile)
Sets the user id to be used to connect with this DataSource.
Parameters:
iuser - the user id.

getMsgFactory

protected com.ibm.u2.jdbc.UniJDBCMsgFactory getMsgFactory()