<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoPlainText>Rest assured, I am a novice egg-sucker. At least now I know that the dialect isn't something I need to worry about.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>I figured out the problem. The 'value' here<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText><span style='font-family:"Courier New"'>    <connectionSource class="ch.qos.logback.core.db.JNDIConnectionSource"><o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>      <param name="jndiLocation" value="jdbc/MyDatabase" /><o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>    </connectionSource><o:p></o:p></span></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>needs to be<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText><span style='font-family:"Courier New"'>    java:comp/env/jdbc/MyDatabase<o:p></o:p></span></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>I don't remember if that's a Tomcat thing or a JTDS thing or some other thing entirely, but some widget I'm using says that if you define a datasource as 'jdbc/FOO', it needs to be referenced as 'java:comp/env/jdbc/FOO'. <o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Sorry for the spam!<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Eric<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>-----Original Message-----<br>From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] On Behalf Of Greg Thomas<br>Sent: Wednesday, March 21, 2012 1:49 PM<br>To: logback users list<br>Subject: Re: [logback-user] DBAppender with JNDI, JTDS</p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>> I read a little about SQLDialect, but I appear to be missing the part <o:p></o:p></p><p class=MsoPlainText>> that shows how to configure it, and there's no dialect for JTDS. Am I <o:p></o:p></p><p class=MsoPlainText>> up the creek here, or is this possible?<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>It looks to me that something odd is going on. I assume you're connecting to the same database in the end, but the DB Appender relies on either<o:p></o:p></p><p class=MsoPlainText>(a) the JDBC driver supporting the getGeneratedKeys() method, *or*<o:p></o:p></p><p class=MsoPlainText>(b) the JDBC driver one of those listed at <a href="http://logback.qos.ch/manual/appenders.html#DBAppender"><span style='color:windowtext;text-decoration:none'>http://logback.qos.ch/manual/appenders.html#DBAppender</span></a> so the record that was inserted can be retrieved using a DB specific statement. You can't specify the dialect - it's detected from the driver class.<o:p></o:p></p><p class=MsoPlainText>[Apologies if the above is teaching you to scuk eggs]<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Now, there's no dialect for JTDS, so you have to rely on the<o:p></o:p></p><p class=MsoPlainText>getGeneratedKeys() method. What I don't understand is why it works with DriverManagerConnectionSource but not JNDIConnectionSource.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>This doesn't help; I started writing a more helpful email, but by the time I finished I realised what I'd started saying was wrong!<o:p></o:p></p><p class=MsoPlainText>Apologies,<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Greg<o:p></o:p></p><p class=MsoPlainText>_______________________________________________<o:p></o:p></p><p class=MsoPlainText>Logback-user mailing list<o:p></o:p></p><p class=MsoPlainText><a href="mailto:Logback-user@qos.ch"><span style='color:windowtext;text-decoration:none'>Logback-user@qos.ch</span></a><o:p></o:p></p><p class=MsoPlainText><a href="http://mailman.qos.ch/mailman/listinfo/logback-user"><span style='color:windowtext;text-decoration:none'>http://mailman.qos.ch/mailman/listinfo/logback-user</span></a><o:p></o:p></p></div></body></html>
<pre>_________________________________________________
Don't gamble with your environmental information. Learn how the world's largest on-demand environmental information management system can help you mitigate your operating risk: www.locustec.com.