Skip Navigation Links | |
Exit Print View | |
Designing with Oracle Java CAPS JCA Adapters Java CAPS Documentation |
Designing with Oracle Java CAPS JCA Adapters
Technical Overview of JCA Adapters
Inbound JCA Resource Adapter Client Code
Outbound JCA Resource Adapter Client Code
Object Type Definition Wizards
Installing the Oracle Java CAPS JCA Adapters
Installing the NetBeans Modules
Installing the Runtime Components for Oracle Java CAPS JCA Adapters
Installing Third-Party JAR Files
Configuring Runtime Components in an EJB/JCA Application
Configuring Connector Pools for File Adapter
Configuring Connector Pools for Oracle Adapter
Deployment of Oracle Java CAPS JCA Adapters
To Deploy JCA Adapters from a Command Line
To Deploy JCA Adapters from the Admin Console
Using the Oracle Applications Wizard and JCA Adapter Tooling with an EJB Project
To implement the Oracle Applications JCA Adapter with an EJB Project
The following task outlines the steps need to implement a specific EJB project where a directory is polled for input data using a query statement (the statement is executed against an Oracle database), and the results are written to an output file.
An OTD and a JAR file containing the code corresponding to the above selected database objects are generated. The OTD is generated in the project at the location src/java/otds. The JAR file is added to the project libraries.
An MDB is created.
The Resource JNDI Name should be the same as that declared in the GlassFish Application Server (for example, Resources > Connector > Connector Resources)
The following code is the output:
public void onContents(byte[] data, String encoding) throws FaultException, InboundException { try { _invoke_getEmpData(data, encoding); } catch (java.lang.Throwable t) { ectx.setRollbackOnly(); java.util.logging.Logger.getLogger(this.getClass().getName()).log(java.util. logging.Level.WARNING, "exception occurred when invoking method: ", t); } try { _invoke_writeEmpData(data, encoding); } catch (java.lang.Throwable t) { ectx.setRollbackOnly(); java.util.logging.Logger.getLogger(this.getClass().getName()).log(java.util. logging.Level.WARNING, "exception occurred when invoking method: ", t); } } private String _execute_getEmpData(byte[] data, String encoding, otd_emp1.Otd_emp1OTD oraOTD) throws java.lang.Exception { //select all records from EMP table using the method select available //on the OTD oraOTD.getEMP().select(""); //Iterate thru the resultset and write to File. while(oraOTD.getEMP().next()) { enameValues = oraOTD.getEMP().getENAME() + ", " + enameValues; } } private void _execute_writeEmpData(byte[] data, String encoding, com.stc.connector.fileadapter.appconn.FileClientApplication fileOTD) throws java.lang.Exception { fileOTD.setText(new String(data)); fileOTD.write(); }