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.CFEnSyntaxMySql.CFEnSyntaxMySqlEnDiscourseTable.java
public void createEnDiscourse(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnDiscourseBuff Buff) { final String S_ProcName = "createEnDiscourse"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*from w w w .ja v a 2s . c o m*/ ResultSet resultSet = null; try { String ClassCode = Buff.getClassCode(); Long ScopeId = Buff.getOptionalScopeId(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); String sql = "call " + schema.getLowerDbSchemaName() + ".sp_create_endisc( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtCreateByPKey == null) { stmtCreateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, ClassCode); if (ScopeId != null) { stmtCreateByPKey.setLong(argIdx++, ScopeId.longValue()); } else { stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtCreateByPKey.setString(argIdx++, Name); try { resultSet = stmtCreateByPKey.executeQuery(); } catch (SQLException e) { if (e.getErrorCode() != 1329) { throw e; } resultSet = null; } if ((resultSet != null) && resultSet.next()) { CFEnSyntaxEnDiscourseBuff createdBuff = unpackEnDiscourseResultSetToBuff(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"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setOptionalScopeId(createdBuff.getOptionalScopeId()); Buff.setRequiredName(createdBuff.getRequiredName()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } 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.CFEnSyntaxMySqlEnAdjectiveTable.java
public void createEnAdjective(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnAdjectiveBuff Buff) { final String S_ProcName = "createEnAdjective"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from w w w .j a v a 2 s. c om ResultSet resultSet = null; try { String ClassCode = Buff.getClassCode(); Long ScopeId = Buff.getOptionalScopeId(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); String sql = "call " + schema.getLowerDbSchemaName() + ".sp_create_enadjec( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtCreateByPKey == null) { stmtCreateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, ClassCode); if (ScopeId != null) { stmtCreateByPKey.setLong(argIdx++, ScopeId.longValue()); } else { stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtCreateByPKey.setString(argIdx++, Name); try { resultSet = stmtCreateByPKey.executeQuery(); } catch (SQLException e) { if (e.getErrorCode() != 1329) { throw e; } resultSet = null; } if ((resultSet != null) && resultSet.next()) { CFEnSyntaxEnAdjectiveBuff createdBuff = unpackEnAdjectiveResultSetToBuff(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"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setOptionalScopeId(createdBuff.getOptionalScopeId()); Buff.setRequiredName(createdBuff.getRequiredName()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } 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.CFEnSyntaxMySqlEnAdverbialTable.java
public void createEnAdverbial(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnAdverbialBuff Buff) { final String S_ProcName = "createEnAdverbial"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*from w ww . j a v a 2s . co m*/ ResultSet resultSet = null; try { String ClassCode = Buff.getClassCode(); Long ScopeId = Buff.getOptionalScopeId(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); String sql = "call " + schema.getLowerDbSchemaName() + ".sp_create_enadvbl( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtCreateByPKey == null) { stmtCreateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, ClassCode); if (ScopeId != null) { stmtCreateByPKey.setLong(argIdx++, ScopeId.longValue()); } else { stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtCreateByPKey.setString(argIdx++, Name); try { resultSet = stmtCreateByPKey.executeQuery(); } catch (SQLException e) { if (e.getErrorCode() != 1329) { throw e; } resultSet = null; } if ((resultSet != null) && resultSet.next()) { CFEnSyntaxEnAdverbialBuff createdBuff = unpackEnAdverbialResultSetToBuff(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"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setOptionalScopeId(createdBuff.getOptionalScopeId()); Buff.setRequiredName(createdBuff.getRequiredName()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } 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.CFEnSyntaxOracle.CFEnSyntaxOracleEnSentenceTable.java
public void createEnSentence(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnSentenceBuff Buff) { final String S_ProcName = "createEnSentence"; ResultSet resultSet = null;//from ww w. j ava2 s .co m CallableStatement stmtCreateByPKey = null; try { String ClassCode = Buff.getClassCode(); Long ScopeId = Buff.getOptionalScopeId(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".crt_ensent( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, ClassCode); if (ScopeId != null) { stmtCreateByPKey.setLong(argIdx++, ScopeId.longValue()); } else { stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtCreateByPKey.setString(argIdx++, Name); stmtCreateByPKey.execute(); resultSet = (ResultSet) stmtCreateByPKey.getObject(1); if (resultSet == null) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_ensent() did not return a result set"); } try { if (resultSet.next()) { CFEnSyntaxEnSentenceBuff createdBuff = unpackEnSentenceResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setOptionalScopeId(createdBuff.getOptionalScopeId()); Buff.setRequiredName(createdBuff.getRequiredName()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_ensent() did not return a valid result set"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtCreateByPKey != null) { try { stmtCreateByPKey.close(); } catch (SQLException e) { } stmtCreateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnModifierTable.java
public void createEnModifier(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnModifierBuff Buff) { final String S_ProcName = "createEnModifier"; ResultSet resultSet = null;//from w w w . j ava 2s . c o m CallableStatement stmtCreateByPKey = null; try { String ClassCode = Buff.getClassCode(); Long ScopeId = Buff.getOptionalScopeId(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".crt_enmodif( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, ClassCode); if (ScopeId != null) { stmtCreateByPKey.setLong(argIdx++, ScopeId.longValue()); } else { stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtCreateByPKey.setString(argIdx++, Name); stmtCreateByPKey.execute(); resultSet = (ResultSet) stmtCreateByPKey.getObject(1); if (resultSet == null) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_enmodif() did not return a result set"); } try { if (resultSet.next()) { CFEnSyntaxEnModifierBuff createdBuff = unpackEnModifierResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setOptionalScopeId(createdBuff.getOptionalScopeId()); Buff.setRequiredName(createdBuff.getRequiredName()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_enmodif() did not return a valid result set"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtCreateByPKey != null) { try { stmtCreateByPKey.close(); } catch (SQLException e) { } stmtCreateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnMorphemeTable.java
public void createEnMorpheme(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnMorphemeBuff Buff) { final String S_ProcName = "createEnMorpheme"; ResultSet resultSet = null;//from w ww . j a va2 s .c o m CallableStatement stmtCreateByPKey = null; try { String ClassCode = Buff.getClassCode(); Long ScopeId = Buff.getOptionalScopeId(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".crt_enmorph( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, ClassCode); if (ScopeId != null) { stmtCreateByPKey.setLong(argIdx++, ScopeId.longValue()); } else { stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtCreateByPKey.setString(argIdx++, Name); stmtCreateByPKey.execute(); resultSet = (ResultSet) stmtCreateByPKey.getObject(1); if (resultSet == null) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_enmorph() did not return a result set"); } try { if (resultSet.next()) { CFEnSyntaxEnMorphemeBuff createdBuff = unpackEnMorphemeResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setOptionalScopeId(createdBuff.getOptionalScopeId()); Buff.setRequiredName(createdBuff.getRequiredName()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_enmorph() did not return a valid result set"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtCreateByPKey != null) { try { stmtCreateByPKey.close(); } catch (SQLException e) { } stmtCreateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxMySql.CFEnSyntaxMySqlEnConnectiveTable.java
public void createEnConnective(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnConnectiveBuff Buff) { final String S_ProcName = "createEnConnective"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from w w w .j av a 2 s .co m ResultSet resultSet = null; try { String ClassCode = Buff.getClassCode(); Long ScopeId = Buff.getOptionalScopeId(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); String sql = "call " + schema.getLowerDbSchemaName() + ".sp_create_enconn( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtCreateByPKey == null) { stmtCreateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, ClassCode); if (ScopeId != null) { stmtCreateByPKey.setLong(argIdx++, ScopeId.longValue()); } else { stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtCreateByPKey.setString(argIdx++, Name); try { resultSet = stmtCreateByPKey.executeQuery(); } catch (SQLException e) { if (e.getErrorCode() != 1329) { throw e; } resultSet = null; } if ((resultSet != null) && resultSet.next()) { CFEnSyntaxEnConnectiveBuff createdBuff = unpackEnConnectiveResultSetToBuff(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"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setOptionalScopeId(createdBuff.getOptionalScopeId()); Buff.setRequiredName(createdBuff.getRequiredName()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } 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_1.CFEnSyntaxMySql.CFEnSyntaxMySqlEnComplementTable.java
public void createEnComplement(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnComplementBuff Buff) { final String S_ProcName = "createEnComplement"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/* w w w . j a va 2 s. co m*/ ResultSet resultSet = null; try { String ClassCode = Buff.getClassCode(); Long ScopeId = Buff.getOptionalScopeId(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); String sql = "call " + schema.getLowerDbSchemaName() + ".sp_create_encompl( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtCreateByPKey == null) { stmtCreateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, ClassCode); if (ScopeId != null) { stmtCreateByPKey.setLong(argIdx++, ScopeId.longValue()); } else { stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtCreateByPKey.setString(argIdx++, Name); try { resultSet = stmtCreateByPKey.executeQuery(); } catch (SQLException e) { if (e.getErrorCode() != 1329) { throw e; } resultSet = null; } if ((resultSet != null) && resultSet.next()) { CFEnSyntaxEnComplementBuff createdBuff = unpackEnComplementResultSetToBuff(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"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setOptionalScopeId(createdBuff.getOptionalScopeId()); Buff.setRequiredName(createdBuff.getRequiredName()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } 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.CFEnSyntaxMySqlEnDeterminerTable.java
public void createEnDeterminer(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnDeterminerBuff Buff) { final String S_ProcName = "createEnDeterminer"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from w w w . ja v a 2s . c o m ResultSet resultSet = null; try { String ClassCode = Buff.getClassCode(); Long ScopeId = Buff.getOptionalScopeId(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); String sql = "call " + schema.getLowerDbSchemaName() + ".sp_create_endeter( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtCreateByPKey == null) { stmtCreateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, ClassCode); if (ScopeId != null) { stmtCreateByPKey.setLong(argIdx++, ScopeId.longValue()); } else { stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtCreateByPKey.setString(argIdx++, Name); try { resultSet = stmtCreateByPKey.executeQuery(); } catch (SQLException e) { if (e.getErrorCode() != 1329) { throw e; } resultSet = null; } if ((resultSet != null) && resultSet.next()) { CFEnSyntaxEnDeterminerBuff createdBuff = unpackEnDeterminerResultSetToBuff(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"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setOptionalScopeId(createdBuff.getOptionalScopeId()); Buff.setRequiredName(createdBuff.getRequiredName()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } 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.CFEnSyntaxOracle.CFEnSyntaxOracleEnAuxiliaryTable.java
public void createEnAuxiliary(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnAuxiliaryBuff Buff) { final String S_ProcName = "createEnAuxiliary"; ResultSet resultSet = null;/* ww w . j a v a 2s . c o m*/ CallableStatement stmtCreateByPKey = null; try { String ClassCode = Buff.getClassCode(); Long ScopeId = Buff.getOptionalScopeId(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".crt_enaux( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, ClassCode); if (ScopeId != null) { stmtCreateByPKey.setLong(argIdx++, ScopeId.longValue()); } else { stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtCreateByPKey.setString(argIdx++, Name); stmtCreateByPKey.execute(); resultSet = (ResultSet) stmtCreateByPKey.getObject(1); if (resultSet == null) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_enaux() did not return a result set"); } try { if (resultSet.next()) { CFEnSyntaxEnAuxiliaryBuff createdBuff = unpackEnAuxiliaryResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setOptionalScopeId(createdBuff.getOptionalScopeId()); Buff.setRequiredName(createdBuff.getRequiredName()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_enaux() did not return a valid result set"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtCreateByPKey != null) { try { stmtCreateByPKey.close(); } catch (SQLException e) { } stmtCreateByPKey = null; } } }