diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRatesBean.java | |
| download | Studium-master.tar.gz Studium-master.tar.bz2 | |
Diffstat (limited to 'Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRatesBean.java')
| -rw-r--r-- | Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRatesBean.java | 46 |
1 files changed, 46 insertions, 0 deletions
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 |
