| Installing Upgrading Designing Configuring Deploying Monitoring Administering Troubleshooting Reference JBI Components | |
| Close Print View | |
| Designing: Adding Prepared Statements |
|
Creating a Runtime Environment
Designing Business Processes in the Sun Business Process Manager
Working with TCP/IP HL7 Collaborations
Developing Sun Master Indexes (Repository)
Developing Sun Master Patient Indexes
Developing OTDs for Application Adapters
Developing OTDs for Communication Adapters
Developing OTDs for Database Adapters
Steps to Edit an Existing Informix OTD
Steps to Edit the OTD from the Java CAPS IDE Include:
To Edit the OTD from the Java CAPS IDE
Editing an Existing Sybase OTD
To Edit the OTD from the Java CAPS IDE
Using the OTD Importer in Netbeans
Developing OTDs for Web Server Adapters
Designing with Application Adapters
Designing with Communication Adapters
Designing with Web Server Adapters
Designing with Sun JCA Adapters
A Prepared Statement OTD represents a SQL statement that has been compiled. Fields in the OTD correspond to the input values that users need to provide. Prepared statements can be used to perform insert, update, delete and query operations. A prepared statement uses a question mark (?) as a place holder for input. For example: insert into EMP_TAB (Age, Name, Dept No) values (?, ?, ?)
To execute a prepared statement, set the input parameters and call executeUpdate() and specify the input values if any.
Note - When using a Prepared Statement, the ”ResultsAvailable()’ method will always return true. Although this method is available, you should not use it with a ”while’ loop. Doing so would result in an infinite loop at runtime and will stop all of the system’s CPU. If it is used, it should only be used with the ”if’ statement.You can process a resultset by looping through the next() method.


Note - When doing a Prepared Statement with two or more tables, where multiple tables have the same column name, you must put the table name qualifier in the Prepared Statement to build the OTD.

Note - The OTD Wizard fails to create OTDs with complex prepared statements that use the same column name in different tables. This problem is resolved by modifying the SQL statement to use column name aliases.
