Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2004 - 2011 Brian McCallister
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  * http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.skife.jdbi.v2.tweak;
Used to convert translated SQL into a prepared statement. The default implementation created by org.skife.jdbi.v2.CachingStatementBuilderFactory caches all prepared statements created against a given handle. A StatementBuilder is always associated with exactly one Handle instance

public interface StatementBuilder
{
    
Called each time a prepared statement needs to be created

Parameters:
conn the JDBC Connection the statement is being created for
sql the translated SQL which should be prepared
ctx Statement context associated with the SQLStatement this is building for
    PreparedStatement create(Connection connString sqlStatementContext ctxthrows SQLException;

Called each time a Callable statement needs to be created

Parameters:
conn the JDBC Connection the statement is being created for
sql the translated SQL which should be prepared
ctx Statement context associated with the SQLStatement this is building for
Called to close an individual prepared statement created from this builder.

Parameters:
sql the translated SQL which was prepared
stmt the statement
Throws:
java.sql.SQLException if anything goes wrong closing the statement
    void close(Connection connString sqlStatement stmtthrows SQLException;

    
Called when the handle this StatementBuilder is attached to is closed.
    void close(Connection conn);
New to GrepCode? Check out our FAQ X