List of usage examples for java.sql Types BIGINT
int BIGINT
To view the source code for java.sql Types BIGINT.
Click Source Link
The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type BIGINT
.
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnAdverbialTable.java
public CFEnSyntaxEnAdverbialBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;/* w w w . j a va2s. c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnAdverbialBuff> buffList = new LinkedList<CFEnSyntaxEnAdverbialBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enadvblbyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnAdverbialBuff buff = unpackEnAdverbialResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnAdverbialBuff[] retBuff = new CFEnSyntaxEnAdverbialBuff[buffList.size()]; Iterator<CFEnSyntaxEnAdverbialBuff> iter = buffList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnConnectiveTable.java
public CFEnSyntaxEnConnectiveBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;//from w ww . j a va 2 s .co m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnConnectiveBuff> buffList = new LinkedList<CFEnSyntaxEnConnectiveBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enconnbyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnConnectiveBuff buff = unpackEnConnectiveResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnConnectiveBuff[] retBuff = new CFEnSyntaxEnConnectiveBuff[buffList.size()]; Iterator<CFEnSyntaxEnConnectiveBuff> iter = buffList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnComplementTable.java
public CFEnSyntaxEnComplementBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;// w w w . j a v a 2s . c om Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnComplementBuff> buffList = new LinkedList<CFEnSyntaxEnComplementBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_encomplbyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnComplementBuff buff = unpackEnComplementResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnComplementBuff[] retBuff = new CFEnSyntaxEnComplementBuff[buffList.size()]; Iterator<CFEnSyntaxEnComplementBuff> iter = buffList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnDeterminerTable.java
public CFEnSyntaxEnDeterminerBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;// www . j av a 2s. co m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnDeterminerBuff> buffList = new LinkedList<CFEnSyntaxEnDeterminerBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_endeterbyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnDeterminerBuff buff = unpackEnDeterminerResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnDeterminerBuff[] retBuff = new CFEnSyntaxEnDeterminerBuff[buffList.size()]; Iterator<CFEnSyntaxEnDeterminerBuff> iter = buffList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:dk.netarkivet.harvester.datamodel.DomainDBDAO.java
/** * Update the list of harvest info for the given domain, keeping IDs where * applicable.//from w w w . j a v a 2s . c o m * @param c * A connection to the database * @param d * A domain to update. * @throws SQLException * If any database problems occur during the update process. */ private void updateHarvestInfo(Connection c, Domain d) throws SQLException { List<Long> oldIDs = DBUtils.selectLongList(c, "SELECT historyinfo.historyinfo_id " + "FROM historyinfo, configurations " + "WHERE historyinfo.config_id " + "= configurations.config_id" + " AND configurations.domain_id = ?", d.getID()); PreparedStatement s = c.prepareStatement("UPDATE historyinfo SET " + "stopreason = ?, " + "objectcount = ?, " + "bytecount = ?, " + "config_id = " + " (SELECT config_id FROM configurations, domains" + " WHERE domains.domain_id = ?" + " AND configurations.name = ?" + " AND configurations.domain_id = domains.domain_id), " + "harvest_id = ?, " + "job_id = ? " + "WHERE historyinfo_id = ?"); Iterator<HarvestInfo> his = d.getHistory().getHarvestInfo(); while (his.hasNext()) { HarvestInfo hi = his.next(); if (hi.hasID() && oldIDs.remove(hi.getID())) { s.setInt(1, hi.getStopReason().ordinal()); s.setLong(2, hi.getCountObjectRetrieved()); s.setLong(3, hi.getSizeDataRetrieved()); s.setLong(4, d.getID()); s.setString(5, d.getConfiguration(hi.getDomainConfigurationName()).getName()); s.setLong(6, hi.getHarvestID()); if (hi.getJobID() != null) { s.setLong(7, hi.getJobID()); } else { s.setNull(7, Types.BIGINT); } s.setLong(8, hi.getID()); s.executeUpdate(); s.clearParameters(); } else { insertHarvestInfo(c, d, hi); } } if (oldIDs.size() != 0) { String message = "Not allowed to delete historyinfo " + oldIDs + " on " + d; log.debug(message); throw new IOFailure(message); } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnPrepositionTable.java
public CFEnSyntaxEnPrepositionBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;/*w ww . j ava 2 s . c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnPrepositionBuff> buffList = new LinkedList<CFEnSyntaxEnPrepositionBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enprepbyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnPrepositionBuff buff = unpackEnPrepositionResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnPrepositionBuff[] retBuff = new CFEnSyntaxEnPrepositionBuff[buffList.size()]; Iterator<CFEnSyntaxEnPrepositionBuff> iter = buffList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnIntensifierTable.java
public CFEnSyntaxEnIntensifierBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;//w w w . j av a2 s . c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnIntensifierBuff> buffList = new LinkedList<CFEnSyntaxEnIntensifierBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enintensbyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnIntensifierBuff buff = unpackEnIntensifierResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnIntensifierBuff[] retBuff = new CFEnSyntaxEnIntensifierBuff[buffList.size()]; Iterator<CFEnSyntaxEnIntensifierBuff> iter = buffList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxMySql.CFEnSyntaxMySqlEnHeadTable.java
public CFEnSyntaxEnHeadBuff readBuffByUNameIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId, String Name) {/*from w w w. ja v a2s. c o m*/ final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "call " + schema.getLowerDbSchemaName() + ".sp_read_enhead_by_unameidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtReadBuffByUNameIdx == null) { stmtReadBuffByUNameIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUNameIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByUNameIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByUNameIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByUNameIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByUNameIdx.setString(argIdx++, Name); try { resultSet = stmtReadBuffByUNameIdx.executeQuery(); } catch (SQLException e) { if (e.getErrorCode() != 1329) { throw e; } resultSet = null; } if ((resultSet != null) && resultSet.next()) { CFEnSyntaxEnHeadBuff buff = unpackEnHeadResultSetToBuff(resultSet); if ((resultSet != null) && resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } 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.cfensyntax.v2_2.CFEnSyntaxMySql.CFEnSyntaxMySqlEnWordTable.java
public CFEnSyntaxEnWordBuff readBuffByUNameIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId, String Name) {/* w w w .java2s .com*/ final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "call " + schema.getLowerDbSchemaName() + ".sp_read_enword_by_unameidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtReadBuffByUNameIdx == null) { stmtReadBuffByUNameIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUNameIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByUNameIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByUNameIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByUNameIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByUNameIdx.setString(argIdx++, Name); try { resultSet = stmtReadBuffByUNameIdx.executeQuery(); } catch (SQLException e) { if (e.getErrorCode() != 1329) { throw e; } resultSet = null; } if ((resultSet != null) && resultSet.next()) { CFEnSyntaxEnWordBuff buff = unpackEnWordResultSetToBuff(resultSet); if ((resultSet != null) && resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } 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.cfensyntax.v2_2.CFEnSyntaxMySql.CFEnSyntaxMySqlEnTenseTable.java
public CFEnSyntaxEnTenseBuff readBuffByUNameIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId, String Name) {/* ww w. j a v a 2 s.c om*/ final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "call " + schema.getLowerDbSchemaName() + ".sp_read_entense_by_unameidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtReadBuffByUNameIdx == null) { stmtReadBuffByUNameIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUNameIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByUNameIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByUNameIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByUNameIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByUNameIdx.setString(argIdx++, Name); try { resultSet = stmtReadBuffByUNameIdx.executeQuery(); } catch (SQLException e) { if (e.getErrorCode() != 1329) { throw e; } resultSet = null; } if ((resultSet != null) && resultSet.next()) { CFEnSyntaxEnTenseBuff buff = unpackEnTenseResultSetToBuff(resultSet); if ((resultSet != null) && resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }