From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- .../integration/loanratesejb/LoanRatesBean.java | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRatesBean.java (limited to 'Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRatesBean.java') diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRatesBean.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRatesBean.java new file mode 100644 index 0000000..f01f25e --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRatesBean.java @@ -0,0 +1,46 @@ +package examples.integration.loanratesejb; + +import javax.resource.cci.*; + +import javax.ejb.Stateless; +import javax.ejb.Remote; +import javax.ejb.TransactionManagement; +import javax.ejb.TransactionManagementType; +import javax.annotation.*; + +@Stateless +@Remote(LoanRates.class) +@TransactionManagement(TransactionManagementType.BEAN) +public class LoanRatesBean implements LoanRates{ + + @Resource (name="OutboundLoanJNDIName") + public javax.resource.cci.ConnectionFactory connFactory; + + public float getHomeEquityRate() { + float retVal=0; + + System.out.println("LoanRatesBean.getHomeEquityRate() called"); + + try { + javax.resource.cci.Connection myCon = connFactory.getConnection(); + javax.resource.cci.Interaction interaction = myCon.createInteraction(); + javax.resource.cci.MappedRecord recordIn = connFactory.getRecordFactory().createMappedRecord(""); + + recordIn.put("HomeEquityRate",""); + + javax.resource.cci.MappedRecord recordOut = + (javax.resource.cci.MappedRecord)interaction.execute(null, (javax.resource.cci.Record)recordIn); + + myCon.close(); + + Object result = recordOut.get("HomeEquityRate"); + retVal = ((Float)result).floatValue(); + + } catch(Exception e) { + + e.printStackTrace(); + } + + return retVal; + } +} \ No newline at end of file -- cgit v1.2.3