首页 > Linux操作系统 > Linux操作系统 > OAF—怎样设置动态的查询(转)
StringBuffer whereClause = new StringBuffer(100);
Vector parameters = new Vector(3);
int clauseCount = 0;
int bindCount = 0;
setWhereClauseParams(null); // Always reset
if ((name != null) && (!("".equals(name.trim()))))
{
whereClause.append(" NAME like :");
whereClause.append(++bindCount);
parameters.addElement(name + "%");
clauseCount++;
}
if ((number != null) && (!(""Equals(number.trim()))))
{
Number supplierId = null;
// SUPPLIER_ID is a NUMBER; datatypes should always
// match, and the parameter passed to this method is a
// String.
try
{
supplierId = new Number(number);
}
catch(Exception e) {}
if (clauseCount > 0)
{
whereClause.append(" AND ");
}
whereClause.append(" SUPPLIER_ID = :");
whereClause.append(++bindCount);
parameters.addElement(supplierId);
clauseCount++;
}
if ((onHold != null) && (!(""Equals(onHold.trim()))))
{
if (clauseCount > 0)
{
whereClause.append(" AND ");
}
whereClause.append(" ON_HOLD_FLAG = :");
whereClause.append(++bindCount);
parameters.addElement("Y");
clauseCount++;
}
setWhereClause(whereClause.toString());
if (bindCount > 0)
{
Object[] params = new Object[bindCount];
// the copyInto() is 1.1.8 compliant which, as of 4/02/03, is required by ARU
parameters.copyInto(params);
setWhereClauseParams(params);
}
executeQuery();
} // end initQuery( )
Genterate an Application Module Interface
If you want to generate an application module interface
so you can invoke typed methods directly
(with compile-time checking) instead of calling
invokeMethod(), you must first create the methods
that you want to expose to the client. Then:
In the JDeveloper Navigator, select the application module
that you just created, right-click and select Edit
In the Application Module Wizard, select Client Methods.
Select the methods you want to be able to invoke remotely in the
Available list and shuttle them to the Selected list.
Select OK to create your interface.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24627116/viewspace-758996/ ,如需转载,请注明出处,否则将追究法律责任。