Code example for Statement

Methods: closeexecuteQuery

0
        Boolean success = false;
 
        try { 
            conn = DriverManager.getConnection(url, user, password);
            stat = conn.createStatement();
            resu = stat.executeQuery(sql);
            handler.Handle(resu);
            success = true;
            resu.close();
            stat.close();
            conn.close();
        } catch (Exception e){
            handler.HandleError(e);
        } finally { 
            return success;
        } 
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java