⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 productdat.java

📁 ORACLE AQ sample 演示的如何出列
💻 JAVA
字号:
package oracle.otnsamples.AQ.Helper;/** * @author  Anupama * @version 1.0 * * Development Environment        :  Oracle9i JPublisher * Name of the Application        :  ProductDat.java * Creation/Modification History  : * *    Anupama      29-Jan-2002      Created * */// SQL importsimport java.sql.SQLException;import java.sql.Connection;// Oracle JDBC importimport oracle.jdbc.OracleTypes;// Oracle SQL Importsimport oracle.sql.ORAData;import oracle.sql.ORADataFactory;import oracle.sql.Datum;import oracle.sql.STRUCT;// Oracle JPublisher importimport oracle.jpub.runtime.MutableStruct;/** * This class is created automatically using oracle JPublisher. It is used to * create a Java Object equivalent to the Oracle Object  * Type present in _SQL_NAME i.e. Product_typ. The datatype of every column * present in the database is mapped to its corresponding OracleType. * This class is mainly used when a queue whose payload is of Oracle object type * should be published.  *  */public class ProductDat implements ORAData, ORADataFactory{  // Name of the Oracle object to which this Java object maps.  public static final String _SQL_NAME = "PRODUCT_TYP";  public static final int _SQL_TYPECODE = OracleTypes.STRUCT;  protected MutableStruct _struct;  // The oracle type equivalent of each column of the Oracle object.  private static int[] _sqlType =  { 12,12,12,12,2,12,2,12,12 };  private static ORADataFactory[] _factory = new ORADataFactory[9];  private static final ProductDat _ProductDatFactory = new ProductDat();  public static ORADataFactory getORADataFactory()  { return _ProductDatFactory; }  /* constructor */  protected ProductDat(boolean init)  { if(init) _struct = new MutableStruct(new Object[9], _sqlType, _factory); }  public ProductDat()  { this(true); }  /* ORAData interface */  public Datum toDatum(Connection c) throws SQLException  {    return _struct.toDatum(c, _SQL_NAME);  }  /* ORADataFactory interface */  public ORAData create(Datum d, int sqlType) throws SQLException  { return create(null, d, sqlType); }  protected ORAData create(ProductDat o, Datum d, int sqlType) throws SQLException  {    if (d == null) return null;     if (o == null) o = new ProductDat(false);    o._struct = new MutableStruct((STRUCT) d, _sqlType, _factory);    return o;  }  /* accessor methods */  public String getProductId() throws SQLException  { return (String) _struct.getAttribute(0); }  public void setProductId(String productId) throws SQLException  { _struct.setAttribute(0, productId); }  public String getManufacturerId() throws SQLException  { return (String) _struct.getAttribute(1); }  public void setManufacturerId(String manufacturerId) throws SQLException  { _struct.setAttribute(1, manufacturerId); }  public String getProductName() throws SQLException  { return (String) _struct.getAttribute(2); }  public void setProductName(String productName) throws SQLException  { _struct.setAttribute(2, productName); }  public String getProductDesc() throws SQLException  { return (String) _struct.getAttribute(3); }  public void setProductDesc(String productDesc) throws SQLException  { _struct.setAttribute(3, productDesc); }  public java.math.BigDecimal getPrice() throws SQLException  { return (java.math.BigDecimal) _struct.getAttribute(4); }  public void setPrice(java.math.BigDecimal price) throws SQLException  { _struct.setAttribute(4, price); }  public String getCategoryDesc() throws SQLException  { return (String) _struct.getAttribute(5); }  public void setCategoryDesc(String categoryDesc) throws SQLException  { _struct.setAttribute(5, categoryDesc); }  public java.math.BigDecimal getQuantityOnHand() throws SQLException  { return (java.math.BigDecimal) _struct.getAttribute(6); }  public void setQuantityOnHand(java.math.BigDecimal quantityOnHand) throws SQLException  { _struct.setAttribute(6, quantityOnHand); }  public String getUserName() throws SQLException  { return (String) _struct.getAttribute(7); }  public void setUserName(String userName) throws SQLException  { _struct.setAttribute(7, userName); }  public String getAction() throws SQLException  { return (String) _struct.getAttribute(8); }  public void setAction(String action) throws SQLException  { _struct.setAttribute(8, action); }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -