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, java.lang.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(java.lang.Object o)
          Equal if two objects have the same hash code, same query, and same parameters.
 java.sql.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,
                                  java.lang.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 java.lang.Object

equals

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

Overrides:
equals in class java.lang.Object

executeQuery

public java.sql.ResultSet executeQuery()
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

setQueryTimeout

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

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

setMaxRows

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

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

executeUpdate

public int executeUpdate()
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

close

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


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