CustomerDBControl.jcx Sample

This topic inludes the source code for the CustomerDBControl.jcx Sample.

Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/ExtensionDevKit/ControlDevKit/ControlFeatures/propEditor/

Sample Source Code


01 package propEditor; 
02 
03 import com.bea.control.*;
04 import java.sql.SQLException; 
05 import java.sql.ResultSet;
06 
07 /** 
08  * @jc:connection data-source-jndi-name="cgSampleDataSource" 
09  * @jcs:jc-jar display-in-palette="false"
10  */ 
11 public interface CustomerDBControl extends com.bea.control.ControlExtension, DatabaseControl 
12 
13     /**
14      * @jc:sql statement="SELECT customername FROM customers WHERE customerid={customerID}"
15      */
16     String selectCustomerName(int customerID);
17 
18     /**
19      * @jc:sql statement="SELECT itemnumber FROM po_items WHERE orderid={orderID}" array-max-length="100"
20      */
21     ResultSet selectItemNumbersByOrder(int orderID);
22 
23     /**
24      * @jc:sql statement="SELECT itemname FROM items WHERE itemnumber={itemNumber}" array-max-length="100"
25      */
26     ResultSet selectItemNameByItemNumber(int itemNumber);
27 
28     /**
29      * @jc:sql statement="SELECT orderid FROM po_customers WHERE customerid={customerID}" array-max-length="100"
30      */
31     ResultSet selectOrdersByCustomer(int customerID);
32 }