craftsman.spy
Class SpyEntity

java.lang.Object
  extended bycraftsman.spy.SpyEntity
Direct Known Subclasses:
SpyResultSet, SpyStatement

public class SpyEntity
extends java.lang.Object

This classe is the base of the Spy JDBC implementation.

Author:
Sébastien LECACHEUR

Field Summary
protected  org.apache.commons.logging.Log log
          Internal used logger.
 
Constructor Summary
SpyEntity(java.sql.Connection c)
          Constructs a new Spy entoty from a JDBC connection.
 
Method Summary
 java.sql.Connection getConnection()
          Returns the used JDBC connection.
 int getId()
          Returns the used JDBC connection identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log
Internal used logger.

Constructor Detail

SpyEntity

public SpyEntity(java.sql.Connection c)
Constructs a new Spy entoty from a JDBC connection.

Parameters:
c - Connection The used JDBC connection.
Method Detail

getId

public int getId()
Returns the used JDBC connection identifier.

Returns:
int The JDBC connection has code otherwise 0.

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Returns the used JDBC connection.

Returns:
Connection The used JDBC connection.
Throws:
java.sql.SQLException - If a database access error occurs. But in this case, the exception will be never throwed.