WebLogic Platform 8.1数据库控件是系统预生成控件中的一种,本文的代码来自
WebLogic Platform 8.1文档.例子和说明如下:
//文件名称为ItemsDatabase .jcx java control extension的意思 package verifyFunds;
import com.bea.control.*; import java.sql.SQLException;
/** * A Database control to support the VerifyFunds sample control. Provides
access * to a database for purchase order requests. * 下面的javadoc定义数据源的JNDI名称 * @jc:connection data-source-jndi-name="cgSampleDataSource" */ public interface ItemsDatabase extends DatabaseControl, com.bea.control.ControlExtension //是数据库控件,并是对com.bea.control.ControlExtension的扩展 { /** * Select item price based on item number. * javadoc表明该方法要执行的SQL,{itemNumber}将用int itemNumber的值代替 * @jc:sql statement="SELECT price FROM items WHERE itemnumber =
{itemNumber}" */ double selectItemPrice(int itemNumber); } WebLogic Platform 8.1 workshop提供了非常友好的界面,让我们直接编辑SQL和方法
名称/说明.WebLogic Platform 8.1数据库控件开发方式是我们梦寐以求的开发方式,
非常不错! 
|