Re: Stored procedures


[ Antworten ] [ Ihre Antwort ] [ Forum www.mannhaupt.com ]

Abgeschickt von Danko am 30 November, 2004 um 20:39:49:

Antwort auf: Stored procedures von Murthy am 29 November, 2004 um 22:12:43:

: I am trying to use the 'storedprocedure' option with the JDBCAppender. I would really appreciate it if anyone could tell me if this is possible.
: Here are the details:

: 1) My Oracle stored procedure takes a number of input parameters and inserts records into 2 tables after making sure that the records are already not present. Can I insert into multiple tables? Since, the inserts are done inside the stored procedure, my thoughts are that it might be possible. Please correct me if I am wrong?

Sure possible.

: 2) The values for the input params themselves need to come from the various log points inside the application. Along with the typical logging entries such as MSG, TIMESTAMP, ...etc, I need to log various application related custom values such as transaction_id, sender_id, receiver_id, ... etc. Since I need to insert custom values, can set up the configuration inside a log4j configuration xml? Or, do I need to setup the configuration from my java code? How do I do it? Are there examples for this?

xml configuration is ok. You need a custom column handler or custom sql handler to write your custom application values. See MyColumnHandler example.

: 3) Assuming that I have to setup the configuration from java code, do I need to write a wrapper class that can be called by the logging points inside the application? A particular method on the wrapper class would take as part of its parameters all the information needed by the stored procedure. The wrapper method would create the logger, set up the configuration and call the stored procedure that would insert into the database.

You would either log a special object (
logger.log(new MyObject(a, b, c))) and/or use column handler code to extract your details from the application or from the log object.

: Am I thinking in the right direction? Any help is highly appreciated.

: Thanks
: Murthy




Antworten:



Ihre Antwort

Name:
E-Mail:

Subject:

Text:

Optionale URL:
Link Titel:
Optionale Bild-URL:


[ Antworten ] [ Ihre Antwort ] [ Forum www.mannhaupt.com ]