Class Query

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.sql.PreparedStatement prepare​(java.sql.Connection connection)
      Prepares the statement using the passed database connection
      java.sql.PreparedStatement prepare​(java.sql.Connection connection, QueryOptions options)
      Prepares the statement using the passed database connection
      Query query()
      Returns the Query representation of this builder instance
      java.lang.String string​(QueryOptions options)
      Transforms this statement into an SQL string
      java.lang.String string​(QueryOptions options, java.sql.Connection connection)
      Transforms this statement into an SQL string
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.github.eikecochu.sqlbuilder.QueryPart

        string
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • string

        public java.lang.String string​(QueryOptions options)
        Description copied from interface: QueryPart
        Transforms this statement into an SQL string
        Specified by:
        string in interface QueryPart
        Parameters:
        options - The QueryOptions to apply for transformation
        Returns:
        The created 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 transformation
        connection - Optional database connection
        Returns:
        The created SQL string
      • prepare

        public java.sql.PreparedStatement prepare​(java.sql.Connection connection)
                                           throws java.sql.SQLException
        Prepares 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.SQLException
        Prepares the statement using the passed database connection
        Parameters:
        connection - The database connection
        options - The QueryOptions to use
        Returns:
        The PreparedStatement
        Throws:
        java.sql.SQLException - if preparing fails
      • query

        public Query query()
        Description copied from interface: QueryBuilder
        Returns the Query representation of this builder instance
        Specified by:
        query in interface QueryBuilder
        Returns:
        The Query representation