i-net JDBC drivers for Oracle Server

com.inet.ora
Class PDataSource

java.lang.Object
  extended bycom.inet.ora.OraDriver
      extended bycom.inet.ora.OraDataSource
          extended bycom.inet.ora.PDataSource
All Implemented Interfaces:
java.lang.Cloneable, javax.sql.ConnectionPoolDataSource, javax.sql.DataSource, java.sql.Driver, javax.naming.Referenceable, java.lang.Runnable, java.io.Serializable

public class PDataSource
extends OraDataSource
implements javax.sql.ConnectionPoolDataSource

This class is the implementation of the ConnectionPoolDataSource in the driver. A sample can be found in the file samples/WithPoolDataSource.java.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.inet.ora.OraDriver
CURSOR
 
Constructor Summary
PDataSource()
          Create an empty DataSource.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this ConnectionPoolDataSource to the specified object.
 java.sql.Connection getConnection()
          override the method in OraDataSource.
 java.sql.Connection getConnection(java.lang.String username, java.lang.String password)
          override the method in OraDataSource.
 java.lang.String getFailoverListener()
          Returns the value of the property failoverListener.
 javax.sql.PooledConnection getPooledConnection()
          This method creates a real connection to the Oracle Server with the parameter of this DataSource.
 javax.sql.PooledConnection getPooledConnection(java.lang.String user, java.lang.String password)
          This method creates a real connection to the Oracle Server with the parameter of this DataSource.
 java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info)
          Overwrites com.inet.ora.OraDriver.getPropertyInfo(String,java.util.Properties) and adds PDataSource specific properies.
 int getTotalTimeOfAttempts()
          Returns the value of the property totalTimeOfAttempts.
 boolean getUseDefaultFailoverListener()
          Returns the value of the property useDefaultFailoverListener.
 int getWaitTimeToNextAttempt()
          Returns the value of the property waitTimeToNextAttempt.
 void setFailoverListener(java.lang.String failoverListener)
          Sets the property failoverListener.
 void setTotalTimeOfAttempts(int totalTimeOfAttempts)
          Sets the property totalTimeOfAttempts.
 void setUseDefaultFailoverListener(boolean useDefaultFailoverListener)
          Sets the property useDefaultFailoverListener.
 void setWaitTimeToNextAttempt(int waitTimeToNextAttempt)
          Sets the property waitTimeToNextAttempt.
 
Methods inherited from class com.inet.ora.OraDataSource
clone, getAlterSession, getCaseSensitive, getColumnsCaseSensitive, getDedicated, getDescription, getFailover, getHost1, getIgnoreScale, getInitSQL, getLoadbalance, getLogging, getLoginTimeout, getLogonMode, getLogWriter, getMapNumbers, getOpencursors, getPassword, getPort, getPort1, getPortNumber, getProgramName, getProperties, getProperty, getProtocol, getQueryTimeout, getReference, getReportUnsupportedMethods, getSduSize, getServerName, getServiceName, getSid, getStreamstolob, getTables, getTimestampToDate, getTraceLevel, getTracePackets, getTraceToSysStream, getUser, setAlterSession, setCaseSensitive, setColumnsCaseSensitive, setDedicated, setDescription, setFailover, setHost1, setIgnoreScale, setInitSQL, setLoadbalance, setLogging, setLoginTimeout, setLogonMode, setLogWriter, setMapNumbers, setOpencursors, setPassword, setPort, setPort1, setPortNumber, setProgramName, setProperties, setProperty, setProperty, setProperty, setProtocol, setQueryTimeout, setReportUnsupportedMethods, setSduSize, setSduSize, setServerName, setServiceName, setSid, setStreamstolob, setTables, setTimestampToDate, setTraceLevel, setTraceLevel, setTracePackets, setTraceToSysStream, setUser, toString
 
Methods inherited from class com.inet.ora.OraDriver
acceptsURL, connect, getMajorVersion, getMinorVersion, jdbcCompliant, run
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sql.ConnectionPoolDataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 

Constructor Detail

PDataSource

public PDataSource()
Create an empty DataSource.

Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
override the method in OraDataSource. This method get a connection from the pool manager Plexa. The connection is a pooled connection.

Specified by:
getConnection in interface javax.sql.DataSource
Overrides:
getConnection in class OraDataSource
Returns:
a connection from a pool
Throws:
java.sql.SQLException - if a database-access error occurs.
See Also:
OraDataSource.getConnection()

getConnection

public java.sql.Connection getConnection(java.lang.String username,
                                         java.lang.String password)
                                  throws java.sql.SQLException
override the method in OraDataSource. This method get a connection from the pool manager Plexa. The connection is a pooled connection.

Specified by:
getConnection in interface javax.sql.DataSource
Overrides:
getConnection in class OraDataSource
Parameters:
username -
password -
Returns:
a connection from a pool
Throws:
java.sql.SQLException - if a database-access error occurs.
See Also:
OraDataSource.getConnection(String,String)

getPooledConnection

public javax.sql.PooledConnection getPooledConnection()
                                               throws java.sql.SQLException
This method creates a real connection to the Oracle Server with the parameter of this DataSource. The real connection is packed in a PooledConnection.
A PooledConnection is NOT a connection with pooling. It is only an auxiliary class for any pool manager.

Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
Returns:
a PooledConnection for this DataSource.
Throws:
java.sql.SQLException - if a database-access error occurs.

getPooledConnection

public javax.sql.PooledConnection getPooledConnection(java.lang.String user,
                                                      java.lang.String password)
                                               throws java.sql.SQLException
This method creates a real connection to the Oracle Server with the parameter of this DataSource. The real connection is packed in a PooledConnection.
A PooledConnection is NOT a connection with pooling. It is only an auxiliary class for any pool manager.

Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
Parameters:
user - the database user on whose behalf the Connection is being made.
password - the user's password.
Returns:
a PooledConnection for this DataSource.
Throws:
java.sql.SQLException - if a database-access error occurs.

equals

public boolean equals(java.lang.Object obj)
Compares this ConnectionPoolDataSource to the specified object. The result is true if and only if the argument is not null and is a PDataSource object that has the same significant properties.

Overrides:
equals in class OraDataSource
Parameters:
obj - the object to compare.

setUseDefaultFailoverListener

public void setUseDefaultFailoverListener(boolean useDefaultFailoverListener)
Sets the property useDefaultFailoverListener. This is a method for MonitoredFailover configuration.

Parameters:
useDefaultFailoverListener - the value for the property useDefaultFailoverListener.

setWaitTimeToNextAttempt

public void setWaitTimeToNextAttempt(int waitTimeToNextAttempt)
Sets the property waitTimeToNextAttempt. This is a method for MonitoredFailover configuration.

Parameters:
waitTimeToNextAttempt - the value for the property waitTimeToNextAttempt.

setTotalTimeOfAttempts

public void setTotalTimeOfAttempts(int totalTimeOfAttempts)
Sets the property totalTimeOfAttempts. This is a method for MonitoredFailover configuration.

Parameters:
totalTimeOfAttempts - the value for the property totalTimeOfAttempts.

setFailoverListener

public void setFailoverListener(java.lang.String failoverListener)
Sets the property failoverListener. This is a method for MonitoredFailover configuration.
The set class have to implement the com.inet.pool.FailoverListener

Parameters:
failoverListener - the value for the property failoverListener.

getUseDefaultFailoverListener

public boolean getUseDefaultFailoverListener()
Returns the value of the property useDefaultFailoverListener.

Returns:
the value of the property useDefaultFailoverListener.

getWaitTimeToNextAttempt

public int getWaitTimeToNextAttempt()
Returns the value of the property waitTimeToNextAttempt.

Returns:
the value of the property waitTimeToNextAttempt.

getTotalTimeOfAttempts

public int getTotalTimeOfAttempts()
Returns the value of the property totalTimeOfAttempts.

Returns:
the value of the property totalTimeOfAttempts.

getFailoverListener

public java.lang.String getFailoverListener()
Returns the value of the property failoverListener.

Returns:
the value of the property failoverListener.

getPropertyInfo

public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url,
                                                     java.util.Properties info)
                                              throws java.sql.SQLException
Overwrites com.inet.ora.OraDriver.getPropertyInfo(String,java.util.Properties) and adds PDataSource specific properies.

Specified by:
getPropertyInfo in interface java.sql.Driver
Returns:
an array of DriverPropertyInfo objects describing possible properties.
Throws:
java.sql.SQLException

i-net JDBC drivers for Oracle Server


copyright by i-net software