【发布时间】:2015-10-22 09:23:14
【问题描述】:
1.9.0 我在 java 中如何做这个 key-next 触发器验证
我是这样的,但在 java adf 中
protected PreparedStatement createStatementADF(String query)
{
PreparedStatement statement=null;
try {
/*create transaction for current statemtnt*/
DBTransaction dbTransaction = (DBTransaction) this.getTransaction();
statement= dbTransaction.createPreparedStatement(query, 0);
} catch (SQLException e)
{
throw new JboException(e);
}
return statement;
}
/*Executes single query*/
protected ResultSet executeQueryADF (String query, Object[] bindVars)
{
PreparedStatement statement=null;
ResultSet ret=null;
try {
/*create transaction for current statemtnt and resuse it*/
statement=createStatementADF(query);
if ((bindVars != null)&&(statement!=null)) {
// 2. Loop over values for the bind variables passed in, if any
for (int z = 0; z < bindVars.length; z++) {
// 3. Set the value of each bind variable in the statement
statement.setObject(z + 1, bindVars[z]);
}
}
// 4. Execute the statement
ret=statement.executeQuery();
} catch (SQLException e) {
throw new JboException(e);
} finally {
if (statement != null) {
try {
// 5. Close the statement
statement.close();
} catch (SQLException e) {
}
}
}
return ret;
}
public void getUsrStatus()
{
ResultSet rs = null;
Object[] bindVars = new Object[]{"TestUser"};
try {
rs = executeQueryADF("SELECT account_status FROM dba_users WHERE username = ?", bindVars );
while(rs.next())
{
//..... process data
}
} catch (Exception e)
{
}
}
我可以在哪里使用 valueChangeListener,我要验证密码并调用程序来验证密码,我必须根据输入的 useid 进行验证
public void labelListener(ValueChangeEvent valueChangeEvent)
{ UIComponent c = valueChangeEvent.getComponent();
//This step actually invokes Update Model phase for this
//component
c.processUpdates(FacesContext.getCurrentInstance());
//Jump to the Render Response phase in order to avoid
//the validation
FacesContext.getCurrentInstance().renderResponse();
}
【问题讨论】:
-
有问题吗?
-
是的,我如何在 adf 中进行此验证
-
您要执行 PL/SQL 还是要将 PL/SQL 转换为 Java?
-
我如何将 pl/sql 转换为 java adf
标签: java oracle oracle-adf