Class SQLStatement
- java.lang.Object
-
- net.ontopia.persistence.query.sql.SQLStatement
-
- All Implemented Interfaces:
SQLStatementIF
public class SQLStatement extends Object implements SQLStatementIF
INTERNAL: The default SQL statement implementation.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
fetchSize
protected ObjectAccessIF
oaccess
protected ParameterProcessorIF
param_processor
protected AccessRegistrarIF
registrar
protected FieldHandlerIF[]
select_fields
protected int[]
select_offsets
protected String
sql
protected int
width
-
Constructor Summary
Constructors Constructor Description SQLStatement(String sql, FieldHandlerIF[] select_fields, ParameterProcessorIF param_processor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResultSet
executeQuery(Connection conn)
INTERNAL: Execute the statement without any parameters and return a JDBC result set.ResultSet
executeQuery(Connection conn, Object[] params)
INTERNAL: Execute the statement with parameters and return a JDBC result set.ResultSet
executeQuery(Connection conn, Map params)
INTERNAL: Execute the statement with parameters and return a JDBC result set.String
getSQL()
TicketIF
getTicket()
int
getWidth()
INTERNAL: Returns the number of fields that will be selected by the statement.Object
readValue(TicketIF ticket, ResultSet rs, int index, boolean lookup_identity)
INTERNAL: Read the field value of the specified index from the current row in the result set.Object[]
readValues(TicketIF ticket, ResultSet rs, boolean lookup_identities)
INTERNAL: Reads all the field values from the current row in the result set.Object[]
readValues(TicketIF ticket, ResultSet rs, Object[] values, boolean lookup_identities)
INTERNAL: Reads all the field values from the current row into the specified value array.void
setAccessRegistrar(AccessRegistrarIF registrar)
void
setFetchSize(int fetchSize)
void
setObjectAccess(ObjectAccessIF oaccess)
String
toString()
-
-
-
Field Detail
-
oaccess
protected ObjectAccessIF oaccess
-
registrar
protected AccessRegistrarIF registrar
-
sql
protected String sql
-
fetchSize
protected int fetchSize
-
width
protected int width
-
select_offsets
protected int[] select_offsets
-
select_fields
protected FieldHandlerIF[] select_fields
-
param_processor
protected ParameterProcessorIF param_processor
-
-
Constructor Detail
-
SQLStatement
public SQLStatement(String sql, FieldHandlerIF[] select_fields, ParameterProcessorIF param_processor)
-
-
Method Detail
-
setObjectAccess
public void setObjectAccess(ObjectAccessIF oaccess)
- Specified by:
setObjectAccess
in interfaceSQLStatementIF
-
setAccessRegistrar
public void setAccessRegistrar(AccessRegistrarIF registrar)
- Specified by:
setAccessRegistrar
in interfaceSQLStatementIF
-
getTicket
public TicketIF getTicket()
- Specified by:
getTicket
in interfaceSQLStatementIF
-
setFetchSize
public void setFetchSize(int fetchSize)
-
getWidth
public int getWidth()
Description copied from interface:SQLStatementIF
INTERNAL: Returns the number of fields that will be selected by the statement.- Specified by:
getWidth
in interfaceSQLStatementIF
-
getSQL
public String getSQL()
-
executeQuery
public ResultSet executeQuery(Connection conn) throws Exception
Description copied from interface:SQLStatementIF
INTERNAL: Execute the statement without any parameters and return a JDBC result set.- Specified by:
executeQuery
in interfaceSQLStatementIF
- Throws:
Exception
-
executeQuery
public ResultSet executeQuery(Connection conn, Object[] params) throws Exception
Description copied from interface:SQLStatementIF
INTERNAL: Execute the statement with parameters and return a JDBC result set.- Specified by:
executeQuery
in interfaceSQLStatementIF
- Throws:
Exception
-
executeQuery
public ResultSet executeQuery(Connection conn, Map params) throws Exception
Description copied from interface:SQLStatementIF
INTERNAL: Execute the statement with parameters and return a JDBC result set.- Specified by:
executeQuery
in interfaceSQLStatementIF
- Throws:
Exception
-
readValue
public Object readValue(TicketIF ticket, ResultSet rs, int index, boolean lookup_identity) throws Exception
Description copied from interface:SQLStatementIF
INTERNAL: Read the field value of the specified index from the current row in the result set.If the field is an identity field or a reference field, the object identity will be extracted and the identity will be used to look up the object in the transaction.
- Specified by:
readValue
in interfaceSQLStatementIF
- Throws:
Exception
-
readValues
public Object[] readValues(TicketIF ticket, ResultSet rs, Object[] values, boolean lookup_identities) throws Exception
Description copied from interface:SQLStatementIF
INTERNAL: Reads all the field values from the current row into the specified value array. Note that this array must have a width that is equal or greater than the width of the result.- Specified by:
readValues
in interfaceSQLStatementIF
- Throws:
Exception
-
readValues
public Object[] readValues(TicketIF ticket, ResultSet rs, boolean lookup_identities) throws Exception
Description copied from interface:SQLStatementIF
INTERNAL: Reads all the field values from the current row in the result set.- Specified by:
readValues
in interfaceSQLStatementIF
- Throws:
Exception
-
-