- import java.sql.Connection;
- import java.sql.PreparedStatement;
- import java.sql.ResultSet;
- try
- {
- Connection conn = pageContext.getApplicationModule(webBean).getOADBTransaction().getJdbcConnection();
- String Query = "SELECT count(*) count from XX_PA_SCO_V where project_id=:1 and CI_ID is not null";
- PreparedStatement stmt = conn.prepareStatement(Query);
- stmt.setString(1, project_id);
- for(ResultSet resultset = stmt.executeQuery(); resultset.next();)
- {
- pageContext.writeDiagnostics(this, "Query Executed", 1);
- result = resultset.getInt("count");;
- pageContext.writeDiagnostics(this, "Query Executed"+ result, 1);
- }
- }
- catch(Exception exception)
- {
- throw new OAException("Error in Staffing Query"+exception, OAException.ERROR);
- }
- if(result >0)
- {
- throw new OAException("One or more Scope Change Order is existing on this project", OAException.INFORMATION);
- }
Sunday, 7 July 2013
Prepared statement in oaf
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment