Example usage for java.sql ResultSet getBoolean

List of usage examples for java.sql ResultSet getBoolean

Introduction

In this page you can find the example usage for java.sql ResultSet getBoolean.

Prototype

boolean getBoolean(String columnLabel) throws SQLException;

Source Link

Document

Retrieves the value of the designated column in the current row of this ResultSet object as a boolean in the Java programming language.

Usage

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskPgSql.CFAsteriskPgSqlTSecGroupTable.java

public void deleteTSecGroupByTenantIdx(CFSecurityAuthorization Authorization, long argTenantId) {
    final String S_ProcName = "deleteTSecGroupByTenantIdx";
    ResultSet resultSet = null;
    try {/* w ww.  j  a  va2  s . c  o  m*/
        Connection cnx = schema.getCnx();
        String sql = "SELECT " + schema.getLowerDbSchemaName()
                + ".sp_delete_tsecgrp_by_tenantidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) as DeletedFlag";
        if (stmtDeleteByTenantIdx == null) {
            stmtDeleteByTenantIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByTenantIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByTenantIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByTenantIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtDeleteByTenantIdx.setLong(argIdx++, argTenantId);
        resultSet = stmtDeleteByTenantIdx.executeQuery();
        if (resultSet.next()) {
            boolean deleteFlag = resultSet.getBoolean(1);
            if (resultSet.next()) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-record response");
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Expected 1 record result set to be returned by delete, not 0 rows");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccPgSql.CFAccPgSqlURLProtocolTable.java

public void deleteURLProtocolByUNameIdx(CFAccAuthorization Authorization, String argName) {
    final String S_ProcName = "deleteURLProtocolByUNameIdx";
    ResultSet resultSet = null;
    try {/*from   w  w  w.  jav a  2s  .  co m*/
        Connection cnx = schema.getCnx();
        String sql = "SELECT " + schema.getLowerSchemaDbName()
                + ".sp_delete_urlproto_by_unameidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) as DeletedFlag";
        if (stmtDeleteByUNameIdx == null) {
            stmtDeleteByUNameIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByUNameIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByUNameIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtDeleteByUNameIdx.setString(argIdx++, argName);
        resultSet = stmtDeleteByUNameIdx.executeQuery();
        if (resultSet.next()) {
            boolean deleteFlag = resultSet.getBoolean(1);
            if (resultSet.next()) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-record response");
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Expected 1 record result set to be returned by delete, not 0 rows");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstPgSql.CFAstPgSqlURLProtocolTable.java

public void deleteURLProtocolByUNameIdx(CFAstAuthorization Authorization, String argName) {
    final String S_ProcName = "deleteURLProtocolByUNameIdx";
    ResultSet resultSet = null;
    try {//from  w  ww  .java 2  s  .c o m
        Connection cnx = schema.getCnx();
        String sql = "SELECT " + schema.getLowerSchemaDbName()
                + ".sp_delete_urlproto_by_unameidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) as DeletedFlag";
        if (stmtDeleteByUNameIdx == null) {
            stmtDeleteByUNameIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByUNameIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByUNameIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtDeleteByUNameIdx.setString(argIdx++, argName);
        resultSet = stmtDeleteByUNameIdx.executeQuery();
        if (resultSet.next()) {
            boolean deleteFlag = resultSet.getBoolean(1);
            if (resultSet.next()) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-record response");
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Expected 1 record result set to be returned by delete, not 0 rows");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstPgSql.CFAstPgSqlURLProtocolTable.java

public void deleteURLProtocolByUNameIdx(CFAstAuthorization Authorization, String argName) {
    final String S_ProcName = "deleteURLProtocolByUNameIdx";
    ResultSet resultSet = null;
    try {//from   w w w  .  ja  v a 2  s  . co m
        Connection cnx = schema.getCnx();
        String sql = "SELECT " + schema.getLowerDbSchemaName()
                + ".sp_delete_urlproto_by_unameidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) as DeletedFlag";
        if (stmtDeleteByUNameIdx == null) {
            stmtDeleteByUNameIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByUNameIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByUNameIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtDeleteByUNameIdx.setString(argIdx++, argName);
        resultSet = stmtDeleteByUNameIdx.executeQuery();
        if (resultSet.next()) {
            boolean deleteFlag = resultSet.getBoolean(1);
            if (resultSet.next()) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-record response");
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Expected 1 record result set to be returned by delete, not 0 rows");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccPgSql.CFAccPgSqlISOCountryTable.java

public void deleteISOCountryByISOCodeIdx(CFAccAuthorization Authorization, String argISOCode) {
    final String S_ProcName = "deleteISOCountryByISOCodeIdx";
    ResultSet resultSet = null;
    try {/*w  w  w  .j  a v a  2  s  .c om*/
        Connection cnx = schema.getCnx();
        String sql = "SELECT " + schema.getLowerSchemaDbName()
                + ".sp_delete_iso_cntry_by_isocodeidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) as DeletedFlag";
        if (stmtDeleteByISOCodeIdx == null) {
            stmtDeleteByISOCodeIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByISOCodeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByISOCodeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByISOCodeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByISOCodeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByISOCodeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtDeleteByISOCodeIdx.setString(argIdx++, argISOCode);
        resultSet = stmtDeleteByISOCodeIdx.executeQuery();
        if (resultSet.next()) {
            boolean deleteFlag = resultSet.getBoolean(1);
            if (resultSet.next()) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-record response");
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Expected 1 record result set to be returned by delete, not 0 rows");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstPgSql.CFAstPgSqlISOCountryTable.java

public void deleteISOCountryByISOCodeIdx(CFAstAuthorization Authorization, String argISOCode) {
    final String S_ProcName = "deleteISOCountryByISOCodeIdx";
    ResultSet resultSet = null;
    try {//from w w w  .ja va2 s  .  co m
        Connection cnx = schema.getCnx();
        String sql = "SELECT " + schema.getLowerSchemaDbName()
                + ".sp_delete_iso_cntry_by_isocodeidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) as DeletedFlag";
        if (stmtDeleteByISOCodeIdx == null) {
            stmtDeleteByISOCodeIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByISOCodeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByISOCodeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByISOCodeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByISOCodeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByISOCodeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtDeleteByISOCodeIdx.setString(argIdx++, argISOCode);
        resultSet = stmtDeleteByISOCodeIdx.executeQuery();
        if (resultSet.next()) {
            boolean deleteFlag = resultSet.getBoolean(1);
            if (resultSet.next()) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-record response");
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Expected 1 record result set to be returned by delete, not 0 rows");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstPgSql.CFAstPgSqlISOCountryTable.java

public void deleteISOCountryByISOCodeIdx(CFAstAuthorization Authorization, String argISOCode) {
    final String S_ProcName = "deleteISOCountryByISOCodeIdx";
    ResultSet resultSet = null;
    try {//from ww  w . j  a v a  2s .  c  o m
        Connection cnx = schema.getCnx();
        String sql = "SELECT " + schema.getLowerDbSchemaName()
                + ".sp_delete_iso_cntry_by_isocodeidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) as DeletedFlag";
        if (stmtDeleteByISOCodeIdx == null) {
            stmtDeleteByISOCodeIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByISOCodeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByISOCodeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByISOCodeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByISOCodeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByISOCodeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtDeleteByISOCodeIdx.setString(argIdx++, argISOCode);
        resultSet = stmtDeleteByISOCodeIdx.executeQuery();
        if (resultSet.next()) {
            boolean deleteFlag = resultSet.getBoolean(1);
            if (resultSet.next()) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-record response");
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Expected 1 record result set to be returned by delete, not 0 rows");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccPgSql.CFAccPgSqlTldTable.java

public void deleteTldByTenantIdx(CFAccAuthorization Authorization, long argTenantId) {
    final String S_ProcName = "deleteTldByTenantIdx";
    ResultSet resultSet = null;
    try {/*from  w  w  w. j ava 2 s  .  c o  m*/
        Connection cnx = schema.getCnx();
        String sql = "SELECT " + schema.getLowerSchemaDbName() + ".sp_delete_tlddef_by_tenantidx( ?, ?, ?, ?, ?"
                + ", " + "?" + " ) as DeletedFlag";
        if (stmtDeleteByTenantIdx == null) {
            stmtDeleteByTenantIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByTenantIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByTenantIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByTenantIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtDeleteByTenantIdx.setLong(argIdx++, argTenantId);
        resultSet = stmtDeleteByTenantIdx.executeQuery();
        if (resultSet.next()) {
            boolean deleteFlag = resultSet.getBoolean(1);
            if (resultSet.next()) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-record response");
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Expected 1 record result set to be returned by delete, not 0 rows");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstPgSql.CFAstPgSqlTldTable.java

public void deleteTldByTenantIdx(CFAstAuthorization Authorization, long argTenantId) {
    final String S_ProcName = "deleteTldByTenantIdx";
    ResultSet resultSet = null;
    try {//from   w  w w  .j av a2 s . c om
        Connection cnx = schema.getCnx();
        String sql = "SELECT " + schema.getLowerSchemaDbName() + ".sp_delete_tlddef_by_tenantidx( ?, ?, ?, ?, ?"
                + ", " + "?" + " ) as DeletedFlag";
        if (stmtDeleteByTenantIdx == null) {
            stmtDeleteByTenantIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByTenantIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByTenantIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByTenantIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtDeleteByTenantIdx.setLong(argIdx++, argTenantId);
        resultSet = stmtDeleteByTenantIdx.executeQuery();
        if (resultSet.next()) {
            boolean deleteFlag = resultSet.getBoolean(1);
            if (resultSet.next()) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-record response");
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Expected 1 record result set to be returned by delete, not 0 rows");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstPgSql.CFAstPgSqlTldTable.java

public void deleteTldByTenantIdx(CFAstAuthorization Authorization, long argTenantId) {
    final String S_ProcName = "deleteTldByTenantIdx";
    ResultSet resultSet = null;
    try {//from  w w  w .ja  v  a 2 s .  c o  m
        Connection cnx = schema.getCnx();
        String sql = "SELECT " + schema.getLowerDbSchemaName() + ".sp_delete_tlddef_by_tenantidx( ?, ?, ?, ?, ?"
                + ", " + "?" + " ) as DeletedFlag";
        if (stmtDeleteByTenantIdx == null) {
            stmtDeleteByTenantIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByTenantIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByTenantIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByTenantIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtDeleteByTenantIdx.setLong(argIdx++, argTenantId);
        resultSet = stmtDeleteByTenantIdx.executeQuery();
        if (resultSet.next()) {
            boolean deleteFlag = resultSet.getBoolean(1);
            if (resultSet.next()) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-record response");
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Expected 1 record result set to be returned by delete, not 0 rows");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}