Releases a SQL PreparedStatement resource. - Android Database

Android examples for Database:Database Connection

Description

Releases a SQL PreparedStatement resource.

Demo Code


//package com.book2s;

import java.sql.PreparedStatement;

import java.sql.SQLException;

public class Main {
    /**//from   w w  w  . j av  a  2s .c o  m
     * Releases a SQL PreparedStatement resource.
     * 
     * @parameter sqlStatement
     * A SQL PreparedStatement object. It's okay if this object is null or if
     * it was never given an actual SQL statement / query to run.
     */
    public static void closeSQLStatement(
            final PreparedStatement sqlStatement) {
        if (sqlStatement != null) {
            try {
                sqlStatement.close();
            } catch (final SQLException e) {

            }
        }
    }
}

Related Tutorials