Lutz Michael wrote:
When I looked over the code, my first thought is that it should use a PreparedStatement instead of a Statement. In this way you will solve a great number of issues (e.g. escaping ' in string literals would not be necessary). The configuration can match the order of the ?s to the properties of the logging event. The code can use PreparedStatement.setObject() to set the parameters and let the JDBC driver worry about mapping types. This would improve performance as well (at least in theory).I will look at it. From what I've seen, it didn't look overly complicated, but I know how database code can get ... especially when you're trying to be RDBMS neutral.Please give me a few days to get back to you (I'm also busy of course). Also, the CLOB support was another point of importance, I'll consider that too. -----Original Message----- From: Ceki Gülcü [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 12, 2003 4:04 PM To: Log4J Developers List Subject: RE: JDBCAppender memory leak issue Mike, Have you looked at the code of JDBC Appender? If so, what do you think? At 13:37 12.02.2003 -0500, you wrote:
Another improvement that immediately comes to mind is an option to use JNDI to get a DataSource instead of specifying the Connection. This would improve performance greatly on application servers where you would get connection pooling. Unfortunately I don't think that really makes the class easier to implement/maintain. (Probably the way to go here would be an abstract base class with an abstract getConnection() method with two concrete classes which get the connection in the two different manners.)
As far as CLOBs go, they can be problematic. For whatever reason, there is no standard way in the JDBC specification to create a java.sql.Clob object for use in the PreparedStatement.setClob() method. The alternative is to use the setXXXStream() methods which are not always implemented in JDBC drivers (at least in one I am familiar with).
Ray
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]