Sun Microsystems eWay JDBC/ODBC Adapter User Manual
Sun Microsystems eWay JDBC/ODBC Adapter User Manual

Sun Microsystems eWay JDBC/ODBC Adapter User Manual

Jdbc/odbc adapter
Table of Contents

Advertisement

Quick Links

SUN SEEBEYOND
eWAY™ JDBC/ODBC ADAPTER
USER'S GUIDE
Release 5.1.2

Advertisement

Table of Contents
loading

Summary of Contents for Sun Microsystems eWay JDBC/ODBC Adapter

  • Page 1 SUN SEEBEYOND eWAY™ JDBC/ODBC ADAPTER USER’S GUIDE Release 5.1.2...
  • Page 2 Java, Sun Java Composite Application Platform Suite, Sun, SeeBeyond, eGate, eInsight, eVision, eTL, eXchange, eView, eIndex, eBAM et eWay sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays. Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc.
  • Page 3: Table Of Contents

    About This Document JDBC eWay Javadoc Scope Intended Audience Text Conventions Related Documents Sun Microsystems, Inc. Web Site Documentation Feedback Chapter 2 Installing the JDBC/ODBC eWay Installing the JDBC eWay Installing the JDBC eWay on an eGate supported system Adding the eWay to an Existing Sun Java Composite Application Platform Suite Installation...
  • Page 4 Specify the OTD Name Review Selections Steps to Edit an Existing JDBC OTD Chapter 5 Using JDBC/ODBC Operations JDBC eWay Database Operations (BPEL) Activity Input and Output JDBC eWay Database Operations (JCD) JDBC/ODBC eWay Adapter User’s Guide Sun Microsystems, Inc.
  • Page 5 Binding the eWay Components Creating an Environment Configuring the eWays Configuring the eWay Properties Configuring the Environment Explorer Properties Configuring the Integration Server Creating the Deployment Profile Creating and Starting the Domain JDBC/ODBC eWay Adapter User’s Guide Sun Microsystems, Inc.
  • Page 6 Configuring the Environment Explorer Properties Configuring the Integration Server Creating the Deployment Profile Creating and Starting the Domain Building and Deploying the Project Running the Sample Project Appendix A JDBC/ODBC Drivers Index JDBC/ODBC eWay Adapter User’s Guide Sun Microsystems, Inc.
  • Page 7: Introducing The Jdbc/Odbc Eway

    About the JDBC/ODBC eWay What’s New in This Release About This Document Related Documents Sun Microsystems, Inc. Web Site Documentation Feedback About Java Database Connectivity (JDBC) Java Database Connectivity (JDBC) is an implementation of the Java programming language that dictates how databases communicate with each other. Through a standardized application programming interface (API), connectivity from database management systems (DBMS) to a wide range of SQL databases is accomplished.
  • Page 8: Type I: Jdbc-Odbc Bridge

    Some ODBC native code and in many cases native database client code must be loaded on each client machine that uses this type of driver. Figure 1 Typical Type 1 Driver Configuration JDBC/ODBC eWay Adapter User’s Guide About Java Database Connectivity (JDBC) Section 1.1 Sun Microsystems, Inc.
  • Page 9: Type Ii: Partial Java Driver

    An example of this type of driver is the Oracle Thick Driver, which is also called OCI (see regarding JDBC eWay support of Oracle drivers). JDBC/ODBC eWay Adapter User’s Guide About Java Database Connectivity (JDBC) JDBC/ODBC Drivers Section 1.1 on page 117 Sun Microsystems, Inc.
  • Page 10: Pure Java Driver For Database Middleware

    DBMS protocol by a server. This net server middleware is able to connect all of its Java technology-based clients to many JDBC/ODBC eWay Adapter User’s Guide About Java Database Connectivity (JDBC) Section 1.1 Sun Microsystems, Inc.
  • Page 11: Type Four Driver: Direct-To-Database Pure Java Driver

    Data Direct Technologies (driver vendor) are Type 4 drivers. Pros: Better performance than Types 1 and 2. No need to install special software on client or server. JDBC/ODBC eWay Adapter User’s Guide About Java Database Connectivity (JDBC) Section 1.1 Sun Microsystems, Inc.
  • Page 12 Scalable Caching Advanced system administration Superior performance Advance Java feature set Does not require applicable database client libraries Cons Each database will require a driver JDBC/ODBC eWay Adapter User’s Guide About Java Database Connectivity (JDBC) Section 1.1 Sun Microsystems, Inc.
  • Page 13: About The Jdbc/Odbc Eway

    Wizard. This allows you to make minor changes to an OTD without having to completely recreate the OTD from scratch. The OTD is then rebuilt, saved, and then relaunched back to the same Java Collaboration or BPEL. JDBC/ODBC eWay Adapter User’s Guide About the JDBC/ODBC eWay Section 1.2 Sun Microsystems, Inc.
  • Page 14: About This Document

    Projects. This document is also intended as a reference guide, listing available properties, functions, and considerations. For a reference of available JDBC eWay Java methods, see the associated Javadoc. JDBC/ODBC eWay Adapter User’s Guide Section 1.4 About This Document Sun Microsystems, Inc.
  • Page 15: Intended Audience

    Sun SeeBeyond eGate™ Integrator User’s Guide Sun Java Composite Application Platform Suite Installation Guide Sun Microsystems, Inc. Web Site The Sun Microsystems web site is your best source for up-to-the-minute product news and technical support information. The site’s URL is: http://www.sun.com JDBC/ODBC eWay Adapter User’s Guide...
  • Page 16: Documentation Feedback

    Chapter 1 Introducing the JDBC/ODBC eWay Documentation Feedback We appreciate your feedback. Please send any comments or suggestions regarding this document to: CAPS_docsfeedback@sun.com JDBC/ODBC eWay Adapter User’s Guide Section 1.7 Documentation Feedback Sun Microsystems, Inc.
  • Page 17: Installing The Jdbc/Odbc Eway

    Note: When the Repository is running on a UNIX operating system, the eWays are loaded from the Suite Installer running on a Windows platform connected to the Repository server using Internet Explorer. JDBC/ODBC eWay Adapter User’s Guide on page 17 on page 19 on page 21 Chapter 2 Sun Microsystems, Inc.
  • Page 18: Installing The Jdbc Eway On An Egate Supported System

    For Step 3 of the wizard, wait for the modules to download, then click Next. The wizard’s Step 4 window displays the installed modules. Review the installed modules and click Finish. JDBC/ODBC eWay Adapter User’s Guide Section 2.1 Installing the JDBC eWay Sun Microsystems, Inc.
  • Page 19: After Installation

    Sun Java Composite Application Platform Suite 5.1.2, do the following: Export the Project Before you export your Projects, save your current ICAN 5.0.x Projects to your Repository. JDBC/ODBC eWay Adapter User’s Guide ICAN 5.0 Project Migration Procedures for instructions on importing the Section 2.2 Sun Microsystems, Inc.
  • Page 20 Check Out from the shortcut menu. The Version Control - Check Out dialog box appears. Select Recurse Project to specify all components, and click OK. JDBC/ODBC eWay Adapter User’s Guide ICAN 5.0 Project Migration Procedures Section 2.2 Sun Microsystems, Inc.
  • Page 21: Installing Enterprise Manager Eway Plug-Ins

    Click the Web Applications Manager tab, go to the Auto-Install from Repository sub-tab, and connect to your Repository. Select the application plug-ins you require, and click Install. The application plug- ins are installed and deployed. JDBC/ODBC eWay Adapter User’s Guide Installing Enterprise Manager eWay Plug-Ins Section 2.3 Sun Microsystems, Inc.
  • Page 22: Viewing Alert Codes

    You may need to verify the following: Server name Database name User Password Port Occurs while Verify that the database has not retrieving a terminated with unexpected connection from the errors. database or the connection pool. Section 2.3 User Actions Sun Microsystems, Inc.
  • Page 23 Transaction isolation is one of the transaction isolation following constants: information of the Connection.TRANSACTION_REA connection. D_UNCOMMITTED Connection.TRANSACTION_REA D_COMMITTED Connection.TRANSACTION_REPE ATABLE_READ Connection.TRANSACTION_SERI ALIZABLE Connection.TRANSACTION_NO Confirm with the Note: vendor that the getIsolation() method of the connection is implemented correctly. Section 2.3 User Actions Sun Microsystems, Inc.
  • Page 24 For information on Managing and Monitoring alert codes and logs, see the Sun SeeBeyond eGate Integrator System Administration Guide. JDBC/ODBC eWay Adapter User’s Guide Installing Enterprise Manager eWay Plug-Ins Section 2.3 Sun Microsystems, Inc.
  • Page 25: Setting Properties Of The Jdbc/Odbc Eway

    (transaction support levels) from which to choose. Transaction support levels provided by the JDBC eWay include: JDBC/ODBC eWay Adapter User’s Guide on page 25 on page 25 on page 29 on page 30 on page 31 Chapter 3 Sun Microsystems, Inc.
  • Page 26 Collaboration can contain only the database eWay, or a combination of database eWay and other eWays that support XA. JDBC/ODBC eWay Adapter User’s Guide Configuring the eWay Connectivity Map Properties JDBC eWay Figure 6 Template window Section 3.2 Sun Microsystems, Inc.
  • Page 27: Transaction Support Levels Between Different Versions

    In 5.1.0, five new records are to be inserted into a table. If the last record fails to insert (such as when a duplicate key exists), all previous records will have been inserted. This is the behavior of NoTransaction support. JDBC/ODBC eWay Adapter User’s Guide Configuring the eWay Connectivity Map Properties Section 3.2 Sun Microsystems, Inc.
  • Page 28 JDBC/ODBC eWay Adapter User’s Guide Configuring the eWay Connectivity Map Properties Java CAPS 5.1.2 Outbound Informix eWay (LocalTransaction) Outbound Informix XA eWay (XATransaction) Java CAPS 5.1.2 Outbound Informix non- Transaction eWay (NoTransaction) Outbound Informix XA eWay (XATransaction) Section 3.2 Sun Microsystems, Inc.
  • Page 29: Configuring The Eway Environment Properties

    Note: For more information on creating an Environment, see the “Sun SeeBeyond eGate Integrator Tutorial”. Right-click the External System created for the JDBC Project and select Properties from the list box. The Environment Configuration Properties window appears. JDBC/ODBC eWay Adapter User’s Guide Configuring the eWay Environment Properties Section 3.3 Sun Microsystems, Inc.
  • Page 30: Eway Connectivity Map Properties

    Outbound eWay Configuration Sections Include: Connectivity Map Outbound eWay Properties Outbound non-Transactional eWay Configuration Settings Include: Connectivity Map Outbound non-Transactional eWay Properties JDBC/ODBC eWay Adapter User’s Guide eWay Connectivity Map Properties on page 31 Section 3.4 on page 31 Sun Microsystems, Inc.
  • Page 31: Connectivity Map Outbound Eway Properties

    Inbound JDBC eWay Properties JDBC/ODBC eWay Adapter User’s Guide on page 31 Description A valid string. Description Any valid string. Description Any valid string. on page 32 Section 3.5 eWay Environment Properties Required Value Required Value Required Value Sun Microsystems, Inc.
  • Page 32: Inbound Jdbc Eway Properties

    The applicable JDBC URL. on page 117 for some of the popular drivers you can use with this eWay. Any valid string. Any valid string. Section 3.5 eWay Environment Properties Required Value JDBC/ODBC Drivers JDBC/ODBC Drivers Sun Microsystems, Inc.
  • Page 33: Jdbc Connector Settings

    A valid port number. Any valid string. Any valid string. Any valid string. Set the driver properties according to driver vendor's instruction. For example: setDefTdpName#DBSQL##setWorkspa ce#Navigator## The default is #. Section 3.5 eWay Environment Properties Required Value Sun Microsystems, Inc.
  • Page 34: Connection Retry Settings

    A valid numeric value. The default is 0. A valid numeric value. The default is A valid numeric value. The default is 0. Description Section 3.5 eWay Environment Properties Required Value Required Value A valid numeric value. The default is 0. Sun Microsystems, Inc.
  • Page 35: Outbound Non-Transactional Jdbc Eway Properties

    JDBC non-Transactional Connection Pool Datasource. A valid class name. For example: com.ddtek.jdbcx.sequelink.SequeLin kDataSource. A valid class name. Any valid string. Section 3.5 eWay Environment Properties Required Value A valid numeric value. The default is 1000. Required Value Sun Microsystems, Inc.
  • Page 36 The default is #. The name of the XADataSource or ConnectionPoolDataSource implementation. This property is Optional. In most cases, leave this box empty. A valid numeric value. The default is 0. Section 3.5 eWay Environment Properties Required Value Sun Microsystems, Inc.
  • Page 37: Connection Retry Settings

    A valid numeric value. The default is A valid numeric value. The default is 0. Description Section 3.5 eWay Environment Properties Required Value Required Value A valid numeric value. The default is 0. A valid numeric value. The default is 1000. Sun Microsystems, Inc.
  • Page 38: Jdbc Connector Settings

    A valid port number. Any valid string. Any valid string. Any valid string. Set the driver properties according to driver vendor's instruction. For example: setDefTdpName#DBSQL##setWorkspa ce#Navigator## The default is #. Section 3.5 eWay Environment Properties Required Value Sun Microsystems, Inc.
  • Page 39: Connection Retry Settings

    A valid numeric value. The default is 0. A valid numeric value. The default is A valid numeric value. The default is 0. Description Section 3.5 eWay Environment Properties Required Value Required Value A valid numeric value. The default is 0. Sun Microsystems, Inc.
  • Page 40 5 seconds apart when the Connection Retries is 10 and the Connection Retry Interval is 5000 JDBC/ODBC eWay Adapter User’s Guide Description A valid numeric value. The default is 1000. Section 3.5 eWay Environment Properties Required Value Sun Microsystems, Inc.
  • Page 41: Using The Jdbc/Odbc Eway Database Wizard

    Creating a New JDBC OTD The following steps are required to create a new OTD for the JDBC Adapter. Select Wizard Type JDBC/ODBC eWay Adapter User’s Guide on page 41 on page 41 on page 56 on page 42 Chapter 4 Sun Microsystems, Inc.
  • Page 42: Select Wizard Type

    JDBC/ODBC eWay Adapter User’s Guide on page 42 on page 43 on page 44 on page 48 on page 52 on page 55 on page 55 Figure 10 OTD Wizard Selection Section 4.2 Creating a New JDBC OTD Sun Microsystems, Inc.
  • Page 43: Select Database Objects

    Procedures, or Prepared Statements you would like to include in the OTD file. Click Next to continue. See Figure 12. Note: Views are read-only and are for informational purposes only. JDBC/ODBC eWay Adapter User’s Guide Creating a New JDBC OTD Section 4.2 Sun Microsystems, Inc.
  • Page 44: Select Tables/Views/Aliases

    Select the types of tables, views, or aliases required in the OTD. Steps Required to Select Table/Views/Aliases Include: In the Select Tables/Views/Aliases window, click Add. See Figure 13. JDBC/ODBC eWay Adapter User’s Guide Figure 12 Select Database Objects Section 4.2 Creating a New JDBC OTD Sun Microsystems, Inc.
  • Page 45 From the Table/View Name drop down list, select the location of your database table and click Search. See Figure 14. JDBC/ODBC eWay Adapter User’s Guide Creating a New JDBC OTD Section 4.2 Sun Microsystems, Inc.
  • Page 46 Creating a New JDBC OTD Figure 14 Database Wizard - All Schemes Select the table of choice and click OK. The table selected is added to the Selected Tables/Views/Aliases section. See Figure 15. JDBC/ODBC eWay Adapter User’s Guide Sun Microsystems, Inc.
  • Page 47 The data type is usually listed as Other when the driver cannot detect the data type. In these situations we recommend changing the data type to one that is more appropriate for the type of column data. JDBC/ODBC eWay Adapter User’s Guide Creating a New JDBC OTD Section 4.2 Sun Microsystems, Inc.
  • Page 48: Select Procedures

    See Figure 17. Figure 17 Table/View Columns — Advanced Select Procedures 4.2.5 Select the type of stored procedures required in your OTD. JDBC/ODBC eWay Adapter User’s Guide Figure 16 Table/View Columns Section 4.2 Creating a New JDBC OTD Sun Microsystems, Inc.
  • Page 49 Click Search. Wildcard characters can also be used. In the resulting Procedure Selection list box, select a Procedure. Click OK. JDBC/ODBC eWay Adapter User’s Guide Creating a New JDBC OTD Section 4.2 Sun Microsystems, Inc.
  • Page 50 To select how you would like the OTD to generate the nodes for the Resultset click Edit Resultsets. JDBC/ODBC eWay Adapter User’s Guide Figure 19 Add Procedures Figure 20 Procedure Parameters Section 4.2 Creating a New JDBC OTD Sun Microsystems, Inc.
  • Page 51 When using "Assist" mode, highlight the execute statement up to and including the table name(s) before executing the query. Section 4.2 Creating a New JDBC OTD Sun Microsystems, Inc.
  • Page 52: Add Prepared Statement

    If you modify the ResultSet generated by the “Execute” mode of the Database Wizard you need to make sure the indexes match the Stored Procedure. This assures your ResultSet indexes are preserved. Section 4.2 Creating a New JDBC OTD Sun Microsystems, Inc.
  • Page 53 Click Add if you want to add additional parameters to the Statement or highlight a row and click Remove to remove it. Click OK. Figure 24. JDBC/ODBC eWay Adapter User’s Guide Figure 22 Prepared Statement Figure 23 Prepared SQL Statement Section 4.2 Creating a New JDBC OTD Sun Microsystems, Inc.
  • Page 54 Click Add to add a new ResultSet column. Both the Name and Type are editable. Click OK to return to the Add Prepared Statements window. JDBC/ODBC eWay Adapter User’s Guide Figure 25 ResultSet Columns Section 4.2 Creating a New JDBC OTD Sun Microsystems, Inc.
  • Page 55: Specify The Otd Name

    If you are satisfied with the OTD information, click Finish to begin generating the OTD. See Figure 27. The resulting OTD appears on the Enterprise Designer’s Project Explorer. JDBC/ODBC eWay Adapter User’s Guide Figure 26 Naming an OTD Section 4.2 Creating a New JDBC OTD Sun Microsystems, Inc.
  • Page 56: Steps To Edit An Existing Jdbc Otd

    OTD. Errors could occur if you delete a database object that is included in a Collaboration. JDBC/ODBC eWay Adapter User’s Guide Steps to Edit an Existing JDBC OTD “Connect To Database” on Section 4.3 Sun Microsystems, Inc.
  • Page 57: Using Jdbc/Odbc Operations

    Using JDBC/ODBC Operations Database operations in the JDBC eWay are used to access the JDBC database. Database operations are either accessed through Activities in BPEL, or through methods called from a JCD Collaboration. What’s in This Chapter JDBC eWay Database Operations (BPEL) JDBC eWay Database Operations (JCD) JDBC eWay Database Operations (BPEL) Within a BPEL business process, the JDBC eWay uses BPEL Activities to perform basic...
  • Page 58 Chapter 5 Using JDBC/ODBC Operations Figure 28 displays the business rules between the FileClient.write and otdJDBC.Db_employeeDelete Activities. In this example, the whereClause appears on the Input side. Figure 28 Input and Output Between Activities The following table lists the expected Input and Output of each database operation Activity.
  • Page 59: Jdbc Eway Database Operations (Jcd)

    Chapter 5 Using JDBC/ODBC Operations Table 13 JDBC.ODBC Operations (Continued) eInsight Operations SelectMultiple number of rows where() clause (optional) SelectOne where() clause (optional) Insert definition of new item to be inserted Update where() clause Delete where() clause JDBC eWay Database Operations (JCD) The same database operations are also used in the JCD, but appear as methods to call from the Collaboration.
  • Page 60: The Table

    Chapter 5 Using JDBC/ODBC Operations operation. Check with the respective driver’s vendor for further information. This feature is known as Updatable ResultSet. Note: Refer to the Javadoc for a full description of methods included in the JDBC eWay. The Table 5.2.1 A table OTD represents a database table.
  • Page 61: The Insert Operation

    Chapter 5 Using JDBC/ODBC Operations FileClient_1.setText( "Selecting record(s) from db_employee table via table select .." ); FileClient_1.write(); otdJDBC_1.getDB_EMPLOYEE().select( input.getText() ); while (otdJDBC_1.getDB_EMPLOYEE().next()) { otdOutputDTD_DBemployee_1.setEmpNo( typeConverter.shortToString( otdJDBC_1.getDB_EMPLOYEE().getEMP_NO(), "#", false, "" ) ); otdOutputDTD_DBemployee_1.setLastname( otdJDBC_1.getDB_EMPLOYEE().getLAST_NAME() ); otdOutputDTD_DBemployee_1.setFirstname( otdJDBC_1.getDB_EMPLOYEE().getFIRST_NAME() ); otdOutputDTD_DBemployee_1.setRate( otdJDBC_1.getDB_EMPLOYEE().getRATE().toString() ); otdOutputDTD_DBemployee_1.setLastDate( typeConverter.dateToString( otdJDBC_1.getDB_EMPLOYEE().getLAST_UPDATE(), "yyyy-MM-dd hh:mm:ss",...
  • Page 62: The Update Operation

    Chapter 5 Using JDBC/ODBC Operations otdInputDTD_DBemployees_1.unmarshalFromString( input.getText() ); for (int i1 = 0; i1 < otdInputDTD_DBemployees_1.countX_sequence_A(); i1 += 1) { otdJDBC_1.getInsert_Ps().setEmp_no( typeConverter.stringToShort( otdInputDTD_DBemployees_1.getX_sequence_A( i1 ).getEmpNo(), "#", false, 0 ) ); otdJDBC_1.getInsert_Ps().setLast_name( otdInputDTD_DBemployees_1.getX_sequence_A( i1 ).getLastname() ); otdJDBC_1.getInsert_Ps().setFirst_name( otdInputDTD_DBemployees_1.getX_sequence_A( i1 ).getFirstname() ); otdJDBC_1.getInsert_Ps().setRate( new java.math.BigDecimal( otdInputDTD_DBemployees_1.getX_sequence_A( i1 ).getRate() ) );...
  • Page 63: The Delete Operation

    Chapter 5 Using JDBC/ODBC Operations otdJDBC_1.getUpdate_Ps().setEmp_no( typeConverter.stringToShort( input.getText(), "#", false, 0 ) ); otdJDBC_1.getUpdate_Ps().executeUpdate(); FileClient_1.setText( "Done Update." ); FileClient_1.write(); The Delete Operation To perform a delete operation on a table: Execute the delete() method. In this example DELETE an employee. package prjJDBC_JCDjcdALL;...
  • Page 64: Executing Stored Procedures

    Chapter 5 Using JDBC/ODBC Operations Executing Stored Procedures The OTD represents the Stored Procedure “LookUpGlobal” with two parameters, an inbound parameter (INLOCALID) and an outbound parameter (OUTGLOBALPRODUCTID). These inbound and outbound parameters are generated by the Database Wizard and are represented in the resulting OTD as nodes. Within the Transformation Designer, you can drag values from the input parameters, execute the call, collect data, and drag the values to the output parameters.
  • Page 65: Manipulating The Resultset And Update Count Returned By Stored Procedure

    Chapter 5 Using JDBC/ODBC Operations FileClient_1.write(); Manipulating the ResultSet and Update Count Returned by Stored Procedure For Stored Procedures that return ResultSets and Update Count, the following methods are provided to manipulate the ResultSet: enableResultSetOnly enableUpdateCountsOnly enableResultSetandUpdateCounts resultsAvailable next getUpdateCount available Many drivers do not support manipulating ResultSets in a Stored Procedure.
  • Page 66 Chapter 5 Using JDBC/ODBC Operations Collaboration usability for a stored procedure ResultSet The Column data of the ResultSets can be dragged-and-dropped from their nodes to the Business Rules. Below is a code snippet that can be generated by the Collaboration Editor: while (getSPIn().getSpS_multi().resultsAvailable()) if (getSPIn().getSpS_multi().getUpdateCount() >...
  • Page 67: Prepared Statement

    Chapter 5 Using JDBC/ODBC Operations parameters are retrieved. Therefore, you should retrieve all ResultSet(s) and Update Counts first followed by retrieving the OUT type parameters and return values. The following list includes specific ResultSet behavior that you may encounter: The method resultsAvailable() implicitly calls getMoreResults() when it is called more than once.
  • Page 68: Further Information

    Chapter 5 Using JDBC/ODBC Operations submit the batch to the database server. Batch operations apply only to Prepared Statements. Not all drivers support batch operations. Check with the respective driver’s vendor for further information. getPrepStatement().getPreparedStatementTest().setAge(23); getPrepStatement().getPreparedStatementTest().setName(‘Peter Pan’); getPrepStatement().getPreparedStatementTest().setDeptNo(6); getPrepStatement().getPreparedStatementTest().addBatch(); getPrepStatement().getPreparedStatementTest().setAge(45); getPrepStatement().getPreparedStatementTest().setName(‘Harrison Ford’);...
  • Page 69: Implementing The Jdbc/Odbc Eway Sample Projects

    There are four business processes that demonstrate the Insert, Update, Delete, and Select operations. Results are written out to an output file. JDBC/ODBC eWay Adapter User’s Guide on page 69 on page 72 on page 73 on page 73 Chapter 6 on page 74 on page 95 Sun Microsystems, Inc.
  • Page 70 TriggerPsSelect.in.~in (for JCE projects only) TriggerTableSelect.in.~in Sample output JCD files JCE_Insert_output().dat JCE_Delete_output().dat JCE_PsUpdate_output().dat JCE_PsSelect_output().dat JCE_TableSelect_output().dat Sample output BPEL files BPEL_PsInsert_output().dat BPEL_Delete_output().dat BPEL_Update_output().dat JDBC/ODBC eWay Adapter User’s Guide Figure 29 Database project flow Section 6.1 About the JDBC eWay Sample Projects Sun Microsystems, Inc.
  • Page 71: Sample Project Data

    The operation automatically changes to an Activity with an icon identifying the component that is the basis for the Activity. JDBC/ODBC eWay Adapter User’s Guide About the JDBC eWay Sample Projects Data Type INTEGER VARCHAR VARCHAR FLOAT TIMESTAMP Section 6.1 Data Length Sun Microsystems, Inc.
  • Page 72: About The Einsight Engine And Egate Components

    Running the Sample Projects The following steps are required to run the sample Projects that are contained in the JDBCeWayDocs.sar file. Run the SQL script. JDBC/ODBC eWay Adapter User’s Guide Running the Sample Projects Section 6.2 Figure Sun Microsystems, Inc.
  • Page 73: Running The Sql Script

    Sample files are uploaded with the eWay’s documentation SAR file, and then downloaded from the Installer’s Documentation tab. The JDBC_eWay_Sample.zip file contains the various sample Project ZIP files. JDBC/ODBC eWay Adapter User’s Guide Section 6.3 Running the SQL Script Sun Microsystems, Inc.
  • Page 74: Building And Deploying The Prjjdbc_Jcd Sample Project

    Steps required to create the sample project Creating a Project Creating the OTDs Creating a Connectivity Map JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project on page 75 on page 75 on page 76 Section 6.5 Sun Microsystems, Inc.
  • Page 75: Creating A Project

    JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project on page 78 on page 81 on page 87 on page 88 on page 89 on page 92 on page 93 on page 94 on page 94 Section 6.5 Sun Microsystems, Inc.
  • Page 76: Creating A Connectivity Map

    Click Finish to complete the DTD based OTD. Repeat this process again to create the second DTD file. Creating a Connectivity Map 6.5.3 The Connectivity Map provides a canvas for assembling and configuring a Project’s components. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Section 6.5 Sun Microsystems, Inc.
  • Page 77: Populating The Connectivity Map

    File1 to FileClientIN File2 to FileClientOUT JDBC1 to esJDBCOUT Rename each Connectivity Map Service to match the intended operation, as for example: jcdDelete JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Section 6.5 Sun Microsystems, Inc.
  • Page 78: Creating The Collaboration Definitions (Java)

    SeeBeyond > eWays > File > FileClient. The Selected OTDs field now lists the FileClient OTD. Click Finish. The Collaboration Editor with the new jcdDelete Collaboration appears in the right pane of the Enterprise Designer. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Section 6.5 Sun Microsystems, Inc.
  • Page 79: Jcdinsert Collaboration

    OTD is added to the Selected OTDs field. Note that the otdOutputDTD_DBemployee OTD is created from the otdOutputDTD.dtd that is included in the Sample Project. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Section 6.5 Sun Microsystems, Inc.
  • Page 80: Jcdtableselect Collaboration

    For Step 2 of the wizard, from the Web Services Interfaces selection window, double-click Sun SeeBeyond > eWays > File > FileClient > receive. The File Name field now displays receive. Click Next. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Section 6.5 Sun Microsystems, Inc.
  • Page 81: Create The Collaboration Business Rules

    For Loop. The Collaboration also writes a message to JCD_Insert_output0.dat to confirm an inserted record. The jcdInsert Collaboration contains the Business Rules displayed in Figure 32. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Section 6.5 Sun Microsystems, Inc.
  • Page 82 ResultSet. for (int i1 = 0; i1 < otdInputDTD_DBemployees_1.countX_sequence_A(); i1 += 1) { otdJDBC_1.getInsert_Ps().setEmp_no( typeConverter.stringToShort( JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Figure 32 jcdInsert Business Rules Section 6.5 Sun Microsystems, Inc.
  • Page 83: Creating The Jcdpsselect Business Rules

    JCD_PsSelect_output0.dat to confirm when records are selected, or when no records are available. The jcdPsSelect Collaboration contains the Business Rules displayed in Figure 33. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Section 6.5 Sun Microsystems, Inc.
  • Page 84 FileClient_1.write(); otdJDBC_1.getSelect_ps().setEmp_no( Short.parseShort( "0" ) ); otdJDBC_1.getSelect_ps().executeQuery(); if (otdJDBC_1.getSelect_ps().resultsAvailable()) { while (otdJDBC_1.getSelect_ps().get$Select_psResults().next()) { JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Section 6.5 Sun Microsystems, Inc.
  • Page 85: Creating The Jcdtableselect Business Rules

    TriggerTableSelect.in file is empty. The jcdTableSelect Collaboration contains the Business Rules displayed in Figure 34. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project otdOutputDTD_DBemployee_1.setEmpNo( Integer.toString( otdOutputDTD_DBemployee_1.setLastname( otdOutputDTD_DBemployee_1.setFirstname( otdOutputDTD_DBemployee_1.setRate( otdOutputDTD_DBemployee_1.setLastDate( FileClient_1.setText( FileClient_1.write(); Section 6.5 Sun Microsystems, Inc.
  • Page 86 ); while (otdJDBC_1.getDB_EMPLOYEE().next()) { otdOutputDTD_DBemployee_1.setEmpNo( typeConverter.shortToString( otdJDBC_1.getDB_EMPLOYEE().getEMP_NO(), "#", false, "" ) ); otdOutputDTD_DBemployee_1.setLastname( otdJDBC_1.getDB_EMPLOYEE().getLAST_NAME() ); otdOutputDTD_DBemployee_1.setFirstname( otdJDBC_1.getDB_EMPLOYEE().getFIRST_NAME() ); JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Section 6.5 Sun Microsystems, Inc.
  • Page 87: Creating The Jcdupdate Business Rules

    The jcdUpdate Collaboration contains the Business Rules displayed in Figure 35. Binding the eWay Components 6.5.6 The final step in creating a Connectivity Map is binding the eWay components together. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Figure 35 jcdTableUpdate Section 6.5 Sun Microsystems, Inc.
  • Page 88: Creating An Environment

    Project and contain the configuration information for these components. Environments are created using the Enterprise Designer’s Environment Editor. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Section 6.5 Sun Microsystems, Inc.
  • Page 89: Configuring The Eways

    Each Connectivity Map in the prjJDBC_JCD sample Project uses three eWays that are represented as nodes between the External Applications and the Business Process. See Figure 38. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Section 6.5 Sun Microsystems, Inc.
  • Page 90: Configuring The Eway Properties

    TriggerInsert.in Input file name TriggerPsSelect.in Input file name TriggerTableSelect.in Input file name TriggerUpdate.in Property Name Output file name JCD_Delete_output%d.dat Output file name JCD_Insert_output%d.dat Output file name JCD_PsSelect_output%d.dat Output file name JCD_TableSelect_output%d.dat Section 6.5 Required Value Required Value Sun Microsystems, Inc.
  • Page 91: Configuring The Environment Explorer Properties

    Enter the name of the particular database that is being used on the server. User Enter the user account name for the database. Password Enter the user account password for the database. Section 6.5 Required Value Required Value Sun Microsystems, Inc.
  • Page 92: Configuring The Integration Server

    Project). Trigger files include: Directory Enter the directory where output files are written. In this sample Project, the output files include: Section 6.5 Required Value TriggerDelete.in.~in TriggerInsert.in.~in TriggerPsSelect.in.~in TriggerTableSelect.in.~in TriggerPsUpdate.in.~in JCD_Delete_output0.dat JCD_Insert_output0.dat JCD_PsSelect_output0.dat JCD_TableSelect_output0.dat JCD_PsUpdate_output0.dat Sun Microsystems, Inc.
  • Page 93: Creating And Starting The Domain

    Note: You are only required to create a domain once when you install the Sun Java Composite Application Platform Suite. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Figure 39 Deployment Profile Section 6.5 Sun Microsystems, Inc.
  • Page 94: Building And Deploying The Project

    The File eWay polls the directory every five seconds for the input file name (as defined in the Inbound File eWay Properties window). The JCD then transforms the JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_JCD Sample Project Section 6.5 Sun Microsystems, Inc.
  • Page 95: Building And Deploying The Prjjdbc_Bpel Sample Project

    69 for more details on the types of output files used on page 95 on page 96 on page 97 on page 107 on page 109 on page 110 on page 113 on page 114 on page 115 on page 115 Section 6.6 About the JDBC Sun Microsystems, Inc.
  • Page 96: Creating The Otds

    Click Add, the Add Prepared Statement window appears. Enter the following: Prepared Statement Name: Select_ps SQL Statement: select * from db_employee where emp_no > ? order by emp_no JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 97: Creating The Business Process

    Create three additional business processes and rename them as follows: bpelUpdate bpelDelete bpTableSelect Add the following Activities to the Business Process Designer canvas. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 98: Configuring The Bpelpsinsert Modeling Elements

    JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Activity FileClient.Receive FileClient.Write otdInputDTD_DBemployees.unmarshal otdJDBC.Insert_PsPSInsert FileClient.Write FileClient.receive FileClient.write otdJDBC.DB_EMPLOYEEUpdate FileClient.write FileClient.receive FileClient.write otdJDBC.DB_EMPLOYEEDelete FileClient.write FileClient.receive FileClient.write otdJDBC.DB_EMPLOYEESelectAll otdInputDTD_DBemployees.marshal FileClient.write FileClient.write Section 6.6 Sun Microsystems, Inc.
  • Page 99 Activity, as seen in Figure 42. Figure 42 bpelPsInsert Business Rule # 2 Configure the business rule between otdInputDTD_DBemployees.unmarshal and the otdJDBC.Insert_psPSInsert Activity, as seen in Figure 43. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 100: Configuring The Bpelupdate Modeling Elements

    This permits you to modify the query to select a specific record. Also note that all records are selected from the database when the TriggerUpdate.in file is empty. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 101 Figure 46 bpelUpdate Business Rule # 1 Configure the business rule between the FileClient.write Activity and otdJDBC.DB_EMPLOYEEUpdate Activity, as seen in Figure 47. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 102: Configuring The Bpeldelete Modeling Elements

    This permits you to modify the query to select a specific record. Also note that all records are selected from the database when the TriggerDelete.in file is empty. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 103 Configure the business rule between the FileClient.write Activity and otdJDBC.DB_EMPLOYEEDelete Activity, as seen in Figure 51. Figure 51 bpDelete Business Rule # 2 JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 104: Configuring The Bpeltableselect Modeling Elements

    Steps required to configure the bpelTableSelect business process: Configure the business rule between the FileClient.receive and FileCleint.write Activities, as seen in Figure 54. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 105 Figure 55 bpelTableSelect Business Rule # 2 Configure the business rule between the otdJDBC.DB_EMPLOYEESelectAll Activity and the otdInputDTD_DBemployees.marshal Activity, as seen in Figure JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 106 Configure the business rule between the FileClient.write Activity and the FileClient.write Activity, as seen in Figure 58. Figure 58 bpelTableSelect Business Rule # 5 JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 107: Creating The Connectivity Map

    Connectivity Map toolbar. Rename the following components and then save changes to the Repository: File1 to FileClientIN File2 to FileClientOUT JDBC1 to eaJDBCOUT JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 108: Binding The Eway Components

    From the bpelDelete Binding dialog box, map FileReceiver to the FileClientOUT External Application, as seen in Figure 59. Figure 59 Connectivity Map - Associating (Binding) the Project’s Components JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 109: Creating An Environment

    Right-click LogicalHost1 and select New > Sun SeeBeyond Integration Server. A new Integration Server (IntegrationSvr1) is added to the Environment Explorer tree under LogicalHost1. See Figure 60). JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 110: Configuring The Eways

    You must configure eWay properties in both the Connectivity Map and the Environment Explorer. Figure 61 eWays in the cmDelete Connectivity Map FileClientIN eWay JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project FileClientOUT eWay eaJDBCOUT eWay Section 6.6 Sun Microsystems, Inc.
  • Page 111: Configuring The Eway Properties

    TriggerDelete.in Input file name TriggerBpInsert.in Input file name TriggerTableSelect.in Input file name TriggerUpdate.in Property Name Output file name BPEL_Delete_output%d.dat Output file name BPEL_Insert_output%d.dat Output file name BPEL_TableSelect_output%d.dat Output file name BPEL_Update_output%d.dat Section 6.6 Required Value Required Value Sun Microsystems, Inc.
  • Page 112 Project). Trigger files include: Directory Enter the directory where output files are written. In this sample Project, the output files include: Section 6.6 Required Value Required Value TriggerBpPsInsert.in.~in TriggerDelete.in.~in TriggerTableSelect.in.~in TriggerBpUpdate.in.~in BPEL_Delete_output0.dat BPEL_PsInsert_output0.dat BPEL_TableSelect_output0.dat BPEL_Update_output0.dat Sun Microsystems, Inc.
  • Page 113: Configuring The Integration Server

    From the Deployment Editor toolbar, click the Automap icon. The Project’s components are automatically mapped to their system windows, as seen in Figure JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 114: Creating And Starting The Domain

    Make any necessary changes to the Create Domain dialog box and click Create. The new domain is added to the Domain Manager. Select the domain and click the Start JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Figure 62 Deployment Profile Section 6.6 Sun Microsystems, Inc.
  • Page 115: Building And Deploying The Project

    You can modify the following input files to view different output. TriggerTableSelect.in TriggerDelete.in TriggerBpUpdate.in Having no content in these files causes the operation to read all records. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project Section 6.6 Sun Microsystems, Inc.
  • Page 116 Project, the input file, and also the content of your database table. JDBC/ODBC eWay Adapter User’s Guide Building and Deploying the prjJDBC_BPEL Sample Project on page 69 for more details on the types of output files used Section 6.6 About the JDBC Sun Microsystems, Inc.
  • Page 117: Jdbc/Odbc Drivers

    Prepared Statements as some drivers always return the data type as a string. Optionally, you may perform the data conversion in the Collaboration. JDBC/ODBC eWay Adapter User’s Guide 32). Appendix A Sun Microsystems, Inc.
  • Page 118 Login name of the account used to access the AS/400 database. Password associated with the login account name used to connect to the AS/400 database. Section A.1 AS/400 Toolbox Driver on page 125 on page 126 on page 118 Sun Microsystems, Inc.
  • Page 119 Password associated with the login account name used to connect to the database. The default is #. The default is 0. The default is 10. The default is 0. on page 120 Section A.2 Attunity Driver on page 119 Sun Microsystems, Inc.
  • Page 120 Attunity Server. Leave password field blank. Value configured when the database entry is created in the Attunity Server. setDefTdpName#<database-logical- name>##setWorkspace#Navigator## The default is #. The default is 0. The default is 10. Section A.2 Attunity Driver Sun Microsystems, Inc.
  • Page 121 Login name of the account used to access the database. Password associated with the login account name used to connect to the database. Value JDBC Connection Pool Datasource ccom.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSou Section A.3 MySQL Connector/J Driver on page 121 Sun Microsystems, Inc.
  • Page 122 Password associated with the login account name used to connect to the database. The default is #. The default is 0. The default is 10. The default is 0. on page 123 Value postgresql-8.0-310.jdbc3.jar org.postgresql.Driver Section A.4 PostgreSQL Driver on page 122 Sun Microsystems, Inc.
  • Page 123 Login name of the account used to access the database. Password associated with the login account name used to connect to the database. The default is #. The default is 0. The default is 10. The default is 0. Section A.4 PostgreSQL Driver Sun Microsystems, Inc.
  • Page 124 JDBC Connection Pool Datasource com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource Server name of the machine hosting the database. <server-port> Note: NOTE: Default server port is 4100. <database-name> Login name of the account used to access the database. Section A.5 SyBase JConnect Driver on page 124 Sun Microsystems, Inc.
  • Page 125 Note: NOTE: Default server port is 19996. Login name of the account used to access the database. Password associated with the login account name used to connect to the database. Section A.6 Sequelink DataDirect Informix ODBC Driver on page 125 Sun Microsystems, Inc.
  • Page 126 Password associated with the login account name used to connect to the database. The default is #. The default is 0. The default is 10. The default is 0. on page 127 Section A.7 on page 127 Sun Microsystems, Inc.
  • Page 127 Login name of the account used to access the database. Password associated with the login account name used to connect to the database. The default is #. The default is 0. The default is 10. Section A.7 Sun Microsystems, Inc.
  • Page 128 Type-3 driver Gateway. Login name of the account used to access the database. Password associated with the login account name used to connect to the database. Value JDBC Connection Pool Datasource com.ncr.teradata.TeraConnectionPoolDataSource Section A.8 Teradata Driver on page 128 Sun Microsystems, Inc.
  • Page 129 Password associated with the login account name used to connect to the database. setURL#jdbc:teradata://<server-name>:<server-port>/ <database-server-name>##setDSName#<database- server_name>## The default is #. The default is 2. The default is 10. The default is 0. Section A.9 Installing JDBC/ODBC Drivers “Sample Projects Drivers” on Sun Microsystems, Inc.
  • Page 130: Troubleshooting

    Not all drivers provide metadata information such as column names and data types. If your table does not have column names and data types, add them before saving the OTD. JDBC/ODBC eWay Adapter User’s Guide Section A.10 Troubleshooting Sun Microsystems, Inc.
  • Page 131: Index

    Outbound JDBC eWay Properties 32, 35, 37 Importing sample Projects 73 Inbound JDBC eWay Properties 32 installation 17 Installing alert codes 22 eWay plug-ins 21 migration procedures 19 Repository on UNIX 17 sample Projects and Javadocs 19 Javadocs, installing 19 Sun Microsystems, Inc.
  • Page 132 15 Sybase JConnect Driver 124 Table SQL operations 60 SQL operations, Delete 63 SQL operations, Insert 61 SQL operations, Select 60 SQL operations, Update 62 Teradata Driver 128 text conventions 15 Transaction Support Levels 27 Troubleshooting 130 Sun Microsystems, Inc.
  • Page 133 Index update count 65 JDBC/ODBC eWay Adapter User’s Guide Sun Microsystems, Inc.

This manual is also suitable for:

Seebeyond eway jdbcSeebeyond eway odbc

Table of Contents