public final class SQLBuffer extends Object implements Serializable, Cloneable
Constructor and Description |
---|
SQLBuffer(DBDictionary dict)
Default constructor.
|
SQLBuffer(SQLBuffer buf)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addCastForParam(String oper,
Val val)
Replace SQL '?'
|
SQLBuffer |
append(Column col) |
SQLBuffer |
append(DBIdentifier name) |
SQLBuffer |
append(Select sel,
JDBCFetchConfiguration fetch)
Append a subselect.
|
SQLBuffer |
append(Sequence seq) |
SQLBuffer |
append(SQLBuffer buf)
Append all SQL and parameters of the given buffer.
|
SQLBuffer |
append(String s) |
SQLBuffer |
append(Table table) |
SQLBuffer |
appendCount(Select sel,
JDBCFetchConfiguration fetch)
Append a subselect count.
|
SQLBuffer |
appendParamOnly(SQLBuffer buf)
Append parameters only if the given buffer at the given positions.
|
SQLBuffer |
appendValue(Object o)
Append a parameter value.
|
SQLBuffer |
appendValue(Object o,
Column col)
Append a system inserted parameter value for a specific column.
|
SQLBuffer |
appendValue(Object o,
Column col,
Parameter userParam)
Append a user parameter value for a specific column.
|
SQLBuffer |
appendValue(Object o,
Column col,
Parameter userParam,
boolean useParamToken) |
Object |
clone()
Perform a shallow clone of this SQL Buffer.
|
boolean |
equals(Object other) |
List |
getColumns() |
List |
getParameters()
Return the list of parameter values.
|
String |
getSQL()
Return the SQL for this buffer.
|
String |
getSQL(boolean replaceParams)
Returns the SQL for this buffer.
|
List |
getUserParameters()
Get the user parameter positions in the list of parameters.
|
int |
hashCode() |
boolean |
isEmpty()
Return true if the buffer is emtpy.
|
CallableStatement |
prepareCall(Connection conn)
Create and populate the parameters of a prepared statement using
the SQL in this buffer.
|
CallableStatement |
prepareCall(Connection conn,
int rsType,
int rsConcur)
Create and populate the parameters of a prepared statement using
the SQL in this buffer.
|
CallableStatement |
prepareCall(Connection conn,
JDBCFetchConfiguration fetch,
int rsType,
int rsConcur)
Create and populate the parameters of a prepred statement using the
SQL in this buffer and the given fetch configuration.
|
PreparedStatement |
prepareStatement(Connection conn)
Create and populate the parameters of a prepared statement using
the SQL in this buffer.
|
PreparedStatement |
prepareStatement(Connection conn,
int rsType,
int rsConcur)
Create and populate the parameters of a prepared statement using
the SQL in this buffer.
|
PreparedStatement |
prepareStatement(Connection conn,
JDBCFetchConfiguration fetch,
int rsType,
int rsConcur)
Create and populate the parameters of a prepred statement using the
SQL in this buffer and the given fetch configuration.
|
boolean |
replace(Select old,
Select sel)
Replace a subselect.
|
void |
replaceSqlString(int start,
int end,
String newString)
Replace current buffer string with the new string
|
void |
setParameters(List params) |
void |
setParameters(PreparedStatement ps)
Populate the parameters of an existing PreparedStatement
with values from this buffer.
|
boolean |
sqlEquals(String sql)
Compare internal SQL without resolving subselects or stringifying
parameters.
|
public SQLBuffer(DBDictionary dict)
public SQLBuffer(SQLBuffer buf)
public Object clone()
public boolean isEmpty()
public SQLBuffer appendParamOnly(SQLBuffer buf)
public SQLBuffer append(DBIdentifier name)
public SQLBuffer append(Select sel, JDBCFetchConfiguration fetch)
public SQLBuffer appendCount(Select sel, JDBCFetchConfiguration fetch)
public SQLBuffer appendValue(Object o, Column col)
public SQLBuffer appendValue(Object o, Column col, Parameter userParam)
userParam
- if non-null, designates a 'user' parameter.public SQLBuffer appendValue(Object o, Column col, Parameter userParam, boolean useParamToken)
public List getParameters()
public List getUserParameters()
getParameters()
list. The even element
of the returned list refers to the user parameter key.
This structure is preferred over a normal map because a user parameter
may occur more than one in the parameters.public String getSQL()
public String getSQL(boolean replaceParams)
replaceParams
- if true, then replace parameters with the
actual parameter valuespublic PreparedStatement prepareStatement(Connection conn) throws SQLException
SQLException
public PreparedStatement prepareStatement(Connection conn, int rsType, int rsConcur) throws SQLException
SQLException
public PreparedStatement prepareStatement(Connection conn, JDBCFetchConfiguration fetch, int rsType, int rsConcur) throws SQLException
SQLException
public CallableStatement prepareCall(Connection conn) throws SQLException
SQLException
public CallableStatement prepareCall(Connection conn, int rsType, int rsConcur) throws SQLException
SQLException
public CallableStatement prepareCall(Connection conn, JDBCFetchConfiguration fetch, int rsType, int rsConcur) throws SQLException
SQLException
public void setParameters(PreparedStatement ps) throws SQLException
SQLException
public boolean sqlEquals(String sql)
public void addCastForParam(String oper, Val val)
oper
- val
- public void replaceSqlString(int start, int end, String newString)
start
- replace start positionend
- replace end positionnewString
- public void setParameters(List params)
public List getColumns()
Copyright © 2006–2018 Apache Software Foundation. All rights reserved.