DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37349>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37349





------- Additional Comments From [EMAIL PROTECTED]  2006-05-01 19:48 -------
Both comments are correct: there is a bug in both the jTDS driver and
DBAppender.  When using the Microsoft SQL Server 2005 JDBC Driver, without using
connection.prepareStatement(insertSQL, Statement.RETURN_GENERATED_KEYS) causes a
SQLException

(In reply to comment #0)
> When using DBAppender with the jTDS driver, it gave the following error: 
> 
> java.sql.SQLException: No current row in the ResultSet. 
> at net.sourceforge.jtds.jdbc.JtdsResultSet.getColumn(JtdsResultSet.java:269) 
> at net.sourceforge.jtds.jdbc.JtdsResultSet.getInt(JtdsResultSet.java:630) 
> at org.apache.log4j.db.DBAppender.append(DBAppender.java:226) 
> at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:239) 
> at
>
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:67)
> 
> at org.apache.log4j.Category.callAppenders(Category.java:219) 
> at org.apache.log4j.Category.forcedLog(Category.java:588) 
> at org.apache.log4j.Category.log(Category.java:1169) 
> at org.apache.commons.logging.impl.Log4JLogger.info(Log4JLogger.java:135) 
>  
> The jTDS developer believe that it's a bug in DBAppender with the following
comment:
> 
> Moving on to the error itself it's indeed caused by DBAppender. It tries to
> retrieve auto generated keys although it didn't request them in the first 
> place:
> it calls prepareStatement(String) instead of prepareStatement(String, int),
> which is needed if auto generated keys are to be retrieved. A second problem 
> is
> that it doesn't even check whether ResultSet.next() returned true or not and 
> it
> just goes for the value which isn't there. Here's the code in question: 
>  
>
http://fisheye.cenqua.com/viewrep/jakarta/jakarta-log4j/src/java/org/apache/log4j/db/DBAppender.java?r=1.17&k=
> 
> 
> For more information, please refer to:
> 
> http://sourceforge.net/forum/forum.php?thread_id=1377897&forum_id=104389
> 
> URL of jTDS: http://jtds.sourceforge.net/

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to