Just not to keep this point open.
After some mails between me and Mariusz we found out, that Mariusz requires stored procedure call, using TSQLStatement class, where user
can set several arguments. Java-based code, which was provided by Mariusz, had look like this:
public static final void setApplicationClientIpHostInfo(Connection
connection, String clientModule, String clientAction,
String clientIpAddress, String clientHostName, String userName) {
OracleCallableStatement stmt = null;
try {
stmt = (OracleCallableStatement) connection.prepareCall("BEGIN
big_brother.set_client_ip_host_operation(:p_client_id,
:p_client_application,
:p_client_ip, :p_client_host, :p_client_operation); END;");
//Set the bind variable inputs
stmt.setStringAtName("p_client_id", userName);
stmt.setStringAtName("p_client_application", clientModule);
stmt.setStringAtName("p_client_ip", clientIpAddress);
stmt.setStringAtName("p_client_host", clientHostName);
stmt.setStringAtName("p_client_operation", clientAction);
stmt.execute();
} catch (Exception e) {
LOGGER.error("Could not setApplicationClientIpHostInfo: " +
e.getMessage());
} finally {
if (stmt != null) {
try {
stmt.close();
} catch (SQLException sqlEx) {
LOGGER.error("Could not close stmtSetClientAppInfo: " +
sqlEx.getMessage());
}
}
}
}
Same functionality one can achieve with ROOT sql classes in the following way:
...
stmt = sql->Statement("BEGIN big_brother.set_client_ip_host_operation(:1, :2, :3, :4, :5); END;");
// literal arguments were replaced by numbers while OCCI does not support such feature
stmt->NextIteration();
stmt->SetString(0, userName);
stmt->SetString(1, clientModule);
stmt->SetString(2, clientIpAddress);
stmt->SetString(3, clientHostName);
stmt->SetString(4, clientAction);
stmt->Process();
...
Here the crutial point was NextIteration() call. Actually, one can make several iteration before calling Process(), which finally will send complete bunch of actions to Oracle.
Sergey