Package com.github.eikecochu.sqlbuilder
Class Query
- java.lang.Object
-
- com.github.eikecochu.sqlbuilder.QueryPartImpl<Query>
-
- com.github.eikecochu.sqlbuilder.Query
-
- All Implemented Interfaces:
QueryBuilder,QueryPart
public class Query extends QueryPartImpl<Query> implements QueryBuilder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.sql.PreparedStatementprepare(java.sql.Connection connection)Prepares the statement using the passed database connectionjava.sql.PreparedStatementprepare(java.sql.Connection connection, QueryOptions options)Prepares the statement using the passed database connectionQueryquery()Returns the Query representation of this builder instancejava.lang.Stringstring(QueryOptions options)Transforms this statement into an SQL stringjava.lang.Stringstring(QueryOptions options, java.sql.Connection connection)Transforms this statement into an SQL stringjava.lang.StringtoString()-
Methods inherited from class com.github.eikecochu.sqlbuilder.QueryPartImpl
ext, parent, sql
-
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
string
public java.lang.String string(QueryOptions options)
Description copied from interface:QueryPartTransforms this statement into an SQL string
-
string
public java.lang.String string(QueryOptions options, java.sql.Connection connection)
Transforms this statement into an SQL string- Parameters:
options- The QueryOptions to apply for transformationconnection- Optional database connection- Returns:
- The created SQL string
-
prepare
public java.sql.PreparedStatement prepare(java.sql.Connection connection) throws java.sql.SQLExceptionPrepares the statement using the passed database connection- Parameters:
connection- The database connection- Returns:
- The PreparedStatement
- Throws:
java.sql.SQLException- if preparing fails
-
prepare
public java.sql.PreparedStatement prepare(java.sql.Connection connection, QueryOptions options) throws java.sql.SQLExceptionPrepares the statement using the passed database connection- Parameters:
connection- The database connectionoptions- The QueryOptions to use- Returns:
- The PreparedStatement
- Throws:
java.sql.SQLException- if preparing fails
-
query
public Query query()
Description copied from interface:QueryBuilderReturns the Query representation of this builder instance- Specified by:
queryin interfaceQueryBuilder- Returns:
- The Query representation
-
-