net.spy.db
Class CachePreparedStatementStub

java.lang.Object
  extended by net.spy.SpyObject
      extended by net.spy.db.GenericPreparedStatementStub
          extended by net.spy.db.CachePreparedStatementStub

public class CachePreparedStatementStub
extends GenericPreparedStatementStub

Prepared statement for executing cached queries


Constructor Summary
CachePreparedStatementStub(SpyDB d, String query, long cTime)
          Create a CachePreparedStatement object for the given query (you probably don't want to do this directly).
 
Method Summary
 void close()
           
 boolean equals(Object o)
          Equal if two objects have the same hash code, same query, and same parameters.
 ResultSet executeQuery()
           
 int executeUpdate()
           
 int hashCode()
          Get an integer hash code to uniquely identify this object.
 void setMaxRows(int to)
          Set the max rows for the query return.
 void setQueryTimeout(int to)
          Set the query timeout.
 
Methods inherited from class net.spy.db.GenericPreparedStatementStub
getApplicableArgs, getArgs, getQuery, getTypes, setBigDecimal, setBoolean, setDate, setDouble, setFloat, setInt, setLong, setNull, setObject, setShort, setString, setTime, setTimestamp
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachePreparedStatementStub

public CachePreparedStatementStub(SpyDB d,
                                  String query,
                                  long cTime)
Create a CachePreparedStatement object for the given query (you probably don't want to do this directly).

Method Detail

hashCode

public int hashCode()
Get an integer hash code to uniquely identify this object.

Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Equal if two objects have the same hash code, same query, and same parameters.

Overrides:
equals in class Object

executeQuery

public ResultSet executeQuery()
                       throws SQLException
Throws:
SQLException

setQueryTimeout

public void setQueryTimeout(int to)
                     throws SQLException
Set the query timeout.

Parameters:
to - the maximum number of seconds
Throws:
SQLException - if the number is not greater than or equal to 0

setMaxRows

public void setMaxRows(int to)
                throws SQLException
Set the max rows for the query return.

Parameters:
to - the maximum number of rows to return
Throws:
SQLException - if the value is not greater than or equal to 0

executeUpdate

public int executeUpdate()
                  throws SQLException
Throws:
SQLException

close

public void close()
           throws SQLException
Overrides:
close in class GenericPreparedStatementStub
Throws:
SQLException


Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.