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.CFEnSyntaxOracleEnHeadTable.java
public CFEnSyntaxEnHeadBuff readBuffByUNameIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId, String Name) {// w w w . j a v a 2 s .com final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUNameIdx = null; try { stmtReadBuffByUNameIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enheadbyunameidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUNameIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadBuffByUNameIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUNameIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnHeadBuff buff = unpackEnHeadResultSetToBuff(resultSet); if (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) { 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; } if (stmtReadBuffByUNameIdx != null) { try { stmtReadBuffByUNameIdx.close(); } catch (SQLException e) { } stmtReadBuffByUNameIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnWordTable.java
public CFEnSyntaxEnWordBuff readBuffByUNameIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId, String Name) {/* w ww . java 2s . c o m*/ final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUNameIdx = null; try { stmtReadBuffByUNameIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enwordbyunameidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUNameIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadBuffByUNameIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUNameIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnWordBuff buff = unpackEnWordResultSetToBuff(resultSet); if (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) { 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; } if (stmtReadBuffByUNameIdx != null) { try { stmtReadBuffByUNameIdx.close(); } catch (SQLException e) { } stmtReadBuffByUNameIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnTenseTable.java
public CFEnSyntaxEnTenseBuff readBuffByUNameIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId, String Name) {//from www. ja v a2s .c o m final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUNameIdx = null; try { stmtReadBuffByUNameIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_entensebyunameidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUNameIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadBuffByUNameIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUNameIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnTenseBuff buff = unpackEnTenseResultSetToBuff(resultSet); if (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) { 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; } if (stmtReadBuffByUNameIdx != null) { try { stmtReadBuffByUNameIdx.close(); } catch (SQLException e) { } stmtReadBuffByUNameIdx = null; } } }
From source file:com.archivas.clienttools.arcutils.utils.database.ManagedJobSchema.java
/** * Updates the stats for all of the files passed in, and also updates the general job statistics * to reflect how many success/failures there were * //from www . jav a 2s .c o m * @param files * - * @throws DatabaseException * - */ @SuppressWarnings({ "ThrowableResultOfMethodCallIgnored" }) public void markFilesProcessed(Collection<FileStats> files) throws DatabaseException { synchronized (DatabaseResourceManager.DB_LOCK) { PooledDbConnection conn = null; try { conn = connPool.getConnection(); PreparedStatement stmt = conn.prepareStatement(MARK_FILE_PROCESSED_STMT_NAME, markFileProcessedSql); conn.setAutoCommit(false); long totalCnt = 0; long totalSize = 0; long successCnt = 0; long successSize = 0; long failCnt = 0; long failSize = 0; long failDirCnt = 0; for (FileStats file : files) { FileStatus status = file.getStatus(); switch (status) { case SUCCEEDED: { if (file.includeInStats()) { successCnt++; successSize += file.getSize(); } break; } case FAILED: { if (file.includeInStats()) { failCnt++; failSize += file.getSize(); if (file.failedDuringFind()) { // in this case we need to increment the total counts as well totalCnt++; totalSize += file.getSize(); // probably zero since we didn't // get that far } } if (file.getArcProcssFile().isDirectory()) { failDirCnt++; } break; } default: throw new RuntimeException("Unsupported file status: " + status); } stmt.clearParameters(); stmt.setInt(1, file.getStatus().ordinal()); stmt.setInt(2, file.getRetries()); Date startTime = file.getStartTime(); if (startTime != null) { stmt.setLong(3, startTime.getTime()); } else { stmt.setNull(3, java.sql.Types.BIGINT); } Date endTime = file.getEndTime(); if (endTime != null) { stmt.setLong(4, endTime.getTime()); } else { stmt.setNull(4, java.sql.Types.BIGINT); } stmt.setLong(5, file.getRunTimeMs()); if (file.getException() == null) { stmt.setNull(6, java.sql.Types.VARCHAR); } else { stmt.setString(6, file.getException().getMessage()); } if (file.getStatusCode() == null) { stmt.setNull(7, java.sql.Types.INTEGER); } else { stmt.setInt(7, file.getStatusCode()); } stmt.setLong(8, file.getDatabaseRecordId()); stmt.addBatch(); } // execute the batch statment to update all of the file rows stmt.executeBatch(); // now update overall job stats to reflect these changes ManagedJobsSchema.getInstance().updateProcessedFilesStats(conn, jobId, totalCnt, totalSize, successCnt, successSize, failCnt, failSize, failDirCnt); conn.commit(); } catch (Exception e) { rollback(conn); throw new DatabaseException(DBUtils.getErrorMessage( "An error occurred updating file stats on table " + qualifiedFilesTableName, e), e); } finally { connPool.returnConnection(conn); } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnObjectTable.java
public CFEnSyntaxEnObjectBuff readBuffByUNameIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId, String Name) {//w w w. j av a 2 s .co m final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUNameIdx = null; try { stmtReadBuffByUNameIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enobjbyunameidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUNameIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadBuffByUNameIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUNameIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnObjectBuff buff = unpackEnObjectResultSetToBuff(resultSet); if (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) { 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; } if (stmtReadBuffByUNameIdx != null) { try { stmtReadBuffByUNameIdx.close(); } catch (SQLException e) { } stmtReadBuffByUNameIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnClauseTable.java
public CFEnSyntaxEnClauseBuff readBuffByUNameIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId, String Name) {// ww w . ja va2 s . c o m final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUNameIdx = null; try { stmtReadBuffByUNameIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enclausebyunameidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUNameIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadBuffByUNameIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUNameIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnClauseBuff buff = unpackEnClauseResultSetToBuff(resultSet); if (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) { 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; } if (stmtReadBuffByUNameIdx != null) { try { stmtReadBuffByUNameIdx.close(); } catch (SQLException e) { } stmtReadBuffByUNameIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnPhraseTable.java
public CFEnSyntaxEnPhraseBuff readBuffByUNameIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId, String Name) {// ww w . j av a 2 s. co m final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUNameIdx = null; try { stmtReadBuffByUNameIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enphrasebyunameidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUNameIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadBuffByUNameIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUNameIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnPhraseBuff buff = unpackEnPhraseResultSetToBuff(resultSet); if (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) { 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; } if (stmtReadBuffByUNameIdx != null) { try { stmtReadBuffByUNameIdx.close(); } catch (SQLException e) { } stmtReadBuffByUNameIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnSubjectTable.java
public CFEnSyntaxEnSubjectBuff readBuffByUNameIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId, String Name) {/*from www .j a v a2s .c o m*/ final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUNameIdx = null; try { stmtReadBuffByUNameIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_ensubjbyunameidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUNameIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadBuffByUNameIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUNameIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnSubjectBuff buff = unpackEnSubjectResultSetToBuff(resultSet); if (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) { 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; } if (stmtReadBuffByUNameIdx != null) { try { stmtReadBuffByUNameIdx.close(); } catch (SQLException e) { } stmtReadBuffByUNameIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnSentenceTable.java
public CFEnSyntaxEnSentenceBuff readBuffByUNameIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId, String Name) {/* w ww .j a va 2 s . co m*/ final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUNameIdx = null; try { stmtReadBuffByUNameIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_ensentbyunameidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUNameIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadBuffByUNameIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUNameIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnSentenceBuff buff = unpackEnSentenceResultSetToBuff(resultSet); if (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) { 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; } if (stmtReadBuffByUNameIdx != null) { try { stmtReadBuffByUNameIdx.close(); } catch (SQLException e) { } stmtReadBuffByUNameIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnModifierTable.java
public CFEnSyntaxEnModifierBuff readBuffByUNameIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId, String Name) {// w w w .j a v a 2 s.co m final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUNameIdx = null; try { stmtReadBuffByUNameIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enmodifbyunameidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUNameIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadBuffByUNameIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUNameIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnModifierBuff buff = unpackEnModifierResultSetToBuff(resultSet); if (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) { 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; } if (stmtReadBuffByUNameIdx != null) { try { stmtReadBuffByUNameIdx.close(); } catch (SQLException e) { } stmtReadBuffByUNameIdx = null; } } }