List of usage examples for java.sql Connection prepareCall
CallableStatement prepareCall(String sql) throws SQLException;
CallableStatement
object for calling database stored procedures. From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnMorphemeTable.java
public void deleteEnMorpheme(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnMorphemeBuff Buff) { final String S_ProcName = "deleteEnMorpheme"; Connection cnx = schema.getCnx(); CallableStatement stmtDeleteByPKey = null; try {// w w w . j av a2 s.co m long Id = Buff.getRequiredId(); stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".dl_enmorph( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtDeleteByPKey.setLong(argIdx++, Id); stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision()); ; stmtDeleteByPKey.execute(); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (stmtDeleteByPKey != null) { try { stmtDeleteByPKey.close(); } catch (SQLException e) { } stmtDeleteByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnSentenceTable.java
public void deleteEnSentence(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnSentenceBuff Buff) { final String S_ProcName = "deleteEnSentence"; Connection cnx = schema.getCnx(); CallableStatement stmtDeleteByPKey = null; try {/*from w w w . ja v a 2 s . c o m*/ long Id = Buff.getRequiredId(); stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".dl_ensent( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtDeleteByPKey.setLong(argIdx++, Id); stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision()); ; stmtDeleteByPKey.execute(); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (stmtDeleteByPKey != null) { try { stmtDeleteByPKey.close(); } catch (SQLException e) { } stmtDeleteByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnSubjectTable.java
public void deleteEnSubject(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnSubjectBuff Buff) { final String S_ProcName = "deleteEnSubject"; Connection cnx = schema.getCnx(); CallableStatement stmtDeleteByPKey = null; try {//from w ww . j a v a 2s. c o m long Id = Buff.getRequiredId(); stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".dl_ensubj( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtDeleteByPKey.setLong(argIdx++, Id); stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision()); ; stmtDeleteByPKey.execute(); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (stmtDeleteByPKey != null) { try { stmtDeleteByPKey.close(); } catch (SQLException e) { } stmtDeleteByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleISOCountryTable.java
public void deleteISOCountry(CFEnSyntaxAuthorization Authorization, CFEnSyntaxISOCountryBuff Buff) { final String S_ProcName = "deleteISOCountry"; Connection cnx = schema.getCnx(); CallableStatement stmtDeleteByPKey = null; try {//from w w w. ja v a 2s. c om short Id = Buff.getRequiredId(); stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".dl_iso_cntry( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtDeleteByPKey.setShort(argIdx++, Id); stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision()); ; stmtDeleteByPKey.execute(); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (stmtDeleteByPKey != null) { try { stmtDeleteByPKey.close(); } catch (SQLException e) { } stmtDeleteByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleSecGroupTable.java
public CFAccSecGroupBuff readBuffByIdIdx(CFAccAuthorization Authorization, long ClusterId, int SecGroupId) { final String S_ProcName = "readBuffByIdIdx"; ResultSet resultSet = null;//from w w w . j a v a 2 s . c om Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByIdIdx = null; try { stmtReadBuffByIdIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_secgrpbyididx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByIdIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByIdIdx.setLong(argIdx++, ClusterId); stmtReadBuffByIdIdx.setInt(argIdx++, SecGroupId); stmtReadBuffByIdIdx.execute(); resultSet = (ResultSet) stmtReadBuffByIdIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAccSecGroupBuff buff = unpackSecGroupResultSetToBuff(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 (stmtReadBuffByIdIdx != null) { try { stmtReadBuffByIdIdx.close(); } catch (SQLException e) { } stmtReadBuffByIdIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleTSecGroupTable.java
public CFAccTSecGroupBuff readBuffByIdIdx(CFAccAuthorization Authorization, long TenantId, int TSecGroupId) { final String S_ProcName = "readBuffByIdIdx"; ResultSet resultSet = null;/*from ww w . ja v a 2s. c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByIdIdx = null; try { stmtReadBuffByIdIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_tsecgrpbyididx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByIdIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByIdIdx.setLong(argIdx++, TenantId); stmtReadBuffByIdIdx.setInt(argIdx++, TSecGroupId); stmtReadBuffByIdIdx.execute(); resultSet = (ResultSet) stmtReadBuffByIdIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAccTSecGroupBuff buff = unpackTSecGroupResultSetToBuff(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 (stmtReadBuffByIdIdx != null) { try { stmtReadBuffByIdIdx.close(); } catch (SQLException e) { } stmtReadBuffByIdIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleSecGroupTable.java
public CFAstSecGroupBuff readBuffByIdIdx(CFAstAuthorization Authorization, long ClusterId, int SecGroupId) { final String S_ProcName = "readBuffByIdIdx"; ResultSet resultSet = null;/*from ww w. ja va2 s . c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByIdIdx = null; try { stmtReadBuffByIdIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_secgrpbyididx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByIdIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByIdIdx.setLong(argIdx++, ClusterId); stmtReadBuffByIdIdx.setInt(argIdx++, SecGroupId); stmtReadBuffByIdIdx.execute(); resultSet = (ResultSet) stmtReadBuffByIdIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAstSecGroupBuff buff = unpackSecGroupResultSetToBuff(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 (stmtReadBuffByIdIdx != null) { try { stmtReadBuffByIdIdx.close(); } catch (SQLException e) { } stmtReadBuffByIdIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleTSecGroupTable.java
public CFAstTSecGroupBuff readBuffByIdIdx(CFAstAuthorization Authorization, long TenantId, int TSecGroupId) { final String S_ProcName = "readBuffByIdIdx"; ResultSet resultSet = null;/*from w w w.jav a2s .c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByIdIdx = null; try { stmtReadBuffByIdIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_tsecgrpbyididx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByIdIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByIdIdx.setLong(argIdx++, TenantId); stmtReadBuffByIdIdx.setInt(argIdx++, TSecGroupId); stmtReadBuffByIdIdx.execute(); resultSet = (ResultSet) stmtReadBuffByIdIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAstTSecGroupBuff buff = unpackTSecGroupResultSetToBuff(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 (stmtReadBuffByIdIdx != null) { try { stmtReadBuffByIdIdx.close(); } catch (SQLException e) { } stmtReadBuffByIdIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleSecGroupTable.java
public CFAstSecGroupBuff readBuffByIdIdx(CFAstAuthorization Authorization, long ClusterId, int SecGroupId) { final String S_ProcName = "readBuffByIdIdx"; ResultSet resultSet = null;/*from w w w.jav a2 s.c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByIdIdx = null; try { stmtReadBuffByIdIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_secgrpbyididx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByIdIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByIdIdx.setLong(argIdx++, ClusterId); stmtReadBuffByIdIdx.setInt(argIdx++, SecGroupId); stmtReadBuffByIdIdx.execute(); resultSet = (ResultSet) stmtReadBuffByIdIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAstSecGroupBuff buff = unpackSecGroupResultSetToBuff(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 (stmtReadBuffByIdIdx != null) { try { stmtReadBuffByIdIdx.close(); } catch (SQLException e) { } stmtReadBuffByIdIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleTSecGroupTable.java
public CFAstTSecGroupBuff readBuffByIdIdx(CFAstAuthorization Authorization, long TenantId, int TSecGroupId) { final String S_ProcName = "readBuffByIdIdx"; ResultSet resultSet = null;// ww w .j a v a 2 s . c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByIdIdx = null; try { stmtReadBuffByIdIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_tsecgrpbyididx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByIdIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByIdIdx.setLong(argIdx++, TenantId); stmtReadBuffByIdIdx.setInt(argIdx++, TSecGroupId); stmtReadBuffByIdIdx.execute(); resultSet = (ResultSet) stmtReadBuffByIdIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAstTSecGroupBuff buff = unpackTSecGroupResultSetToBuff(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 (stmtReadBuffByIdIdx != null) { try { stmtReadBuffByIdIdx.close(); } catch (SQLException e) { } stmtReadBuffByIdIdx = null; } } }