|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.base.database.CachedPreparedStatement
public class CachedPreparedStatement
Allows PreparedStatement information to be cached. A prepared statement consists of a SQL statement containing bind variables as well as variable values. For example, the SQL statement "SELECT * FROM person WHERE age > ?" would have the integer variable 18 (which replaces the "?" chracter) to find all adults. This class encapsulates both the SQL string and bind variable values so that actual PreparedStatement can be created from that information later.
Constructor Summary | |
---|---|
CachedPreparedStatement()
Constructs a new CachedPreparedStatement. |
|
CachedPreparedStatement(java.lang.String sql)
Constructs a new CachedPreparedStatement |
Method Summary | |
---|---|
void |
addBoolean(boolean value)
Adds a boolean parameter to the prepared statement. |
void |
addInt(int value)
Adds an integer parameter to the prepared statement. |
void |
addLong(long value)
Adds a long parameter to the prepared statement. |
void |
addString(java.lang.String value)
Adds a String parameter to the prepared statement. |
boolean |
equals(java.lang.Object object)
|
int |
getCachedSize()
Returns the approximate size of the Object in bytes. |
java.lang.String |
getSQL()
Returns the SQL. |
int |
hashCode()
|
void |
readExternal(java.io.DataInput in)
|
void |
setParams(java.sql.PreparedStatement pstmt)
Sets all parameters on the given PreparedStatement. |
void |
setSQL(java.lang.String sql)
Sets the SQL. |
java.lang.String |
toString()
|
void |
writeExternal(java.io.DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CachedPreparedStatement()
public CachedPreparedStatement(java.lang.String sql)
sql
- Method Detail |
---|
public java.lang.String getSQL()
public void setSQL(java.lang.String sql)
sql
- the SQL.public void addBoolean(boolean value)
value
- the boolean value.public void addInt(int value)
value
- the int value.public void addLong(long value)
value
- the long value.public void addString(java.lang.String value)
value
- the String value.public void setParams(java.sql.PreparedStatement pstmt) throws java.sql.SQLException
PreparedStatement pstmt = con.prepareStatement(cachedPstmt.getSQL()); cachedPstmt.setParams(pstmt);
pstmt
- the prepared statement.
java.sql.SQLException
- if an SQL Exception occurs.public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int getCachedSize()
Cacheable
getCachedSize
in interface Cacheable
public void readExternal(java.io.DataInput in) throws java.io.IOException
readExternal
in interface com.tangosol.io.ExternalizableLite
java.io.IOException
public void writeExternal(java.io.DataOutput out) throws java.io.IOException
writeExternal
in interface com.tangosol.io.ExternalizableLite
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |