logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carn...@apache.org
Subject svn commit: r558362 [25/33] - in /logging/site/trunk/docs/log4j/companions/receivers: ./ apidocs/ apidocs/org/ apidocs/org/apache/ apidocs/org/apache/log4j/ apidocs/org/apache/log4j/db/ apidocs/org/apache/log4j/db/class-use/ apidocs/org/apache/log4j/db...
Date Sat, 21 Jul 2007 17:50:44 GMT
Added: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DBReceiver.html
URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DBReceiver.html?view=auto&rev=558362
==============================================================================
--- logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DBReceiver.html (added)
+++ logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DBReceiver.html Sat Jul 21 10:50:33 2007
@@ -0,0 +1,153 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>DBReceiver xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../../../../apidocs/org/apache/log4j/db/DBReceiver.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em class="comment">/*</em>
+<a name="2" href="#2">2</a>   <em class="comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</em>
+<a name="3" href="#3">3</a>   <em class="comment"> * contributor license agreements.  See the NOTICE file distributed with</em>
+<a name="4" href="#4">4</a>   <em class="comment"> * this work for additional information regarding copyright ownership.</em>
+<a name="5" href="#5">5</a>   <em class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</em>
+<a name="6" href="#6">6</a>   <em class="comment"> * (the "License"); you may not use this file except in compliance with</em>
+<a name="7" href="#7">7</a>   <em class="comment"> * the License.  You may obtain a copy of the License at</em>
+<a name="8" href="#8">8</a>   <em class="comment"> *</em>
+<a name="9" href="#9">9</a>   <em class="comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="10" href="#10">10</a>  <em class="comment"> *</em>
+<a name="11" href="#11">11</a>  <em class="comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="12" href="#12">12</a>  <em class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a name="13" href="#13">13</a>  <em class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a name="14" href="#14">14</a>  <em class="comment"> * See the License for the specific language governing permissions and</em>
+<a name="15" href="#15">15</a>  <em class="comment"> * limitations under the License.</em>
+<a name="16" href="#16">16</a>  <em class="comment"> */</em>
+<a name="17" href="#17">17</a>  
+<a name="18" href="#18">18</a>  <strong>package</strong> org.apache.log4j.db;
+<a name="19" href="#19">19</a>  
+<a name="20" href="#20">20</a>  <strong>import</strong> org.apache.log4j.plugins.Pauseable;
+<a name="21" href="#21">21</a>  <strong>import</strong> org.apache.log4j.plugins.Receiver;
+<a name="22" href="#22">22</a>  <strong>import</strong> org.apache.log4j.scheduler.Scheduler;
+<a name="23" href="#23">23</a>  <strong>import</strong> org.apache.log4j.spi.LoggerRepositoryEx;
+<a name="24" href="#24">24</a>  <strong>import</strong> org.apache.log4j.xml.DOMConfigurator;
+<a name="25" href="#25">25</a>  <strong>import</strong> org.apache.log4j.xml.UnrecognizedElementHandler;
+<a name="26" href="#26">26</a>  <strong>import</strong> org.w3c.dom.Element;
+<a name="27" href="#27">27</a>  
+<a name="28" href="#28">28</a>  <strong>import</strong> java.util.Properties;
+<a name="29" href="#29">29</a>  
+<a name="30" href="#30">30</a>  <em>/**<em>*</em></em>
+<a name="31" href="#31">31</a>  <em> *</em>
+<a name="32" href="#32">32</a>  <em> * @author Scott Deboy &lt;sdeboy@apache.org></em>
+<a name="33" href="#33">33</a>  <em> * @author Ceki G&amp;uuml;lc&amp;uuml;</em>
+<a name="34" href="#34">34</a>  <em> *</em>
+<a name="35" href="#35">35</a>  <em> */</em>
+<a name="36" href="#36">36</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../org/apache/log4j/db/DBReceiver.html">DBReceiver</a> <strong>extends</strong> Receiver implements Pauseable, UnrecognizedElementHandler {
+<a name="37" href="#37">37</a>    <em>/**<em>*</em></em>
+<a name="38" href="#38">38</a>  <em>   * By default we refresh data every 1000 milliseconds.</em>
+<a name="39" href="#39">39</a>  <em>   * @see #setRefreshMillis</em>
+<a name="40" href="#40">40</a>  <em>   */</em>
+<a name="41" href="#41">41</a>    <strong>static</strong> <strong>int</strong> DEFAULT_REFRESH_MILLIS = 1000;
+<a name="42" href="#42">42</a>    <a href="../../../../org/apache/log4j/db/ConnectionSource.html">ConnectionSource</a> connectionSource;
+<a name="43" href="#43">43</a>    <strong>int</strong> refreshMillis = DEFAULT_REFRESH_MILLIS;
+<a name="44" href="#44">44</a>    <a href="../../../../org/apache/log4j/db/DBReceiverJob.html">DBReceiverJob</a> receiverJob;
+<a name="45" href="#45">45</a>    <strong>boolean</strong> paused = false;
+<a name="46" href="#46">46</a>  
+<a name="47" href="#47">47</a>    <strong>public</strong> <strong>void</strong> activateOptions() {
+<a name="48" href="#48">48</a>      
+<a name="49" href="#49">49</a>      <strong>if</strong>(connectionSource == <strong>null</strong>)  {
+<a name="50" href="#50">50</a>        <strong>throw</strong> <strong>new</strong> IllegalStateException(
+<a name="51" href="#51">51</a>          <span class="string">"DBAppender cannot function without a connection source"</span>);
+<a name="52" href="#52">52</a>      }
+<a name="53" href="#53">53</a>    
+<a name="54" href="#54">54</a>      receiverJob = <strong>new</strong> <a href="../../../../org/apache/log4j/db/DBReceiverJob.html">DBReceiverJob</a>(<strong>this</strong>);
+<a name="55" href="#55">55</a>      receiverJob.setLoggerRepository(repository);
+<a name="56" href="#56">56</a>        
+<a name="57" href="#57">57</a>      <strong>if</strong>(<strong>this</strong>.repository == <strong>null</strong>) {
+<a name="58" href="#58">58</a>        <strong>throw</strong> <strong>new</strong> IllegalStateException(
+<a name="59" href="#59">59</a>        <span class="string">"DBAppender cannot function without a reference to its owning repository"</span>);
+<a name="60" href="#60">60</a>      }
+<a name="61" href="#61">61</a>  
+<a name="62" href="#62">62</a>      <strong>if</strong> (repository instanceof LoggerRepositoryEx) {
+<a name="63" href="#63">63</a>          Scheduler scheduler = ((LoggerRepositoryEx) repository).getScheduler();
+<a name="64" href="#64">64</a>      
+<a name="65" href="#65">65</a>          scheduler.schedule(
+<a name="66" href="#66">66</a>              receiverJob, System.currentTimeMillis() + 500, refreshMillis);
+<a name="67" href="#67">67</a>      }
+<a name="68" href="#68">68</a>     
+<a name="69" href="#69">69</a>    }
+<a name="70" href="#70">70</a>  
+<a name="71" href="#71">71</a>    <strong>public</strong> <strong>void</strong> setRefreshMillis(<strong>int</strong> refreshMillis) {
+<a name="72" href="#72">72</a>      <strong>this</strong>.refreshMillis = refreshMillis;
+<a name="73" href="#73">73</a>    }
+<a name="74" href="#74">74</a>  
+<a name="75" href="#75">75</a>    <strong>public</strong> <strong>int</strong> getRefreshMillis() {
+<a name="76" href="#76">76</a>      <strong>return</strong> refreshMillis;
+<a name="77" href="#77">77</a>    }
+<a name="78" href="#78">78</a>  
+<a name="79" href="#79">79</a>  
+<a name="80" href="#80">80</a>    <em>/**<em>*</em></em>
+<a name="81" href="#81">81</a>  <em>   * @return Returns the connectionSource.</em>
+<a name="82" href="#82">82</a>  <em>   */</em>
+<a name="83" href="#83">83</a>    <strong>public</strong> <a href="../../../../org/apache/log4j/db/ConnectionSource.html">ConnectionSource</a> getConnectionSource() {
+<a name="84" href="#84">84</a>      <strong>return</strong> connectionSource;
+<a name="85" href="#85">85</a>    }
+<a name="86" href="#86">86</a>  
+<a name="87" href="#87">87</a>  
+<a name="88" href="#88">88</a>    <em>/**<em>*</em></em>
+<a name="89" href="#89">89</a>  <em>   * @param connectionSource The connectionSource to set.</em>
+<a name="90" href="#90">90</a>  <em>   */</em>
+<a name="91" href="#91">91</a>    <strong>public</strong> <strong>void</strong> setConnectionSource(<a href="../../../../org/apache/log4j/db/ConnectionSource.html">ConnectionSource</a> connectionSource) {
+<a name="92" href="#92">92</a>      <strong>this</strong>.connectionSource = connectionSource;
+<a name="93" href="#93">93</a>    }
+<a name="94" href="#94">94</a>  
+<a name="95" href="#95">95</a>  
+<a name="96" href="#96">96</a>    <em class="comment">/*<em class="comment"> (non-Javadoc)</em></em>
+<a name="97" href="#97">97</a>  <em class="comment">   * @see org.apache.log4j.plugins.Plugin#shutdown()</em>
+<a name="98" href="#98">98</a>  <em class="comment">   */</em>
+<a name="99" href="#99">99</a>    <strong>public</strong> <strong>void</strong> shutdown() {
+<a name="100" href="#100">100</a>     getLogger().info(<span class="string">"removing receiverJob from the Scheduler."</span>);
+<a name="101" href="#101">101</a> 
+<a name="102" href="#102">102</a>     <strong>if</strong>(<strong>this</strong>.repository instanceof LoggerRepositoryEx) {
+<a name="103" href="#103">103</a>       Scheduler scheduler = ((LoggerRepositoryEx) repository).getScheduler();
+<a name="104" href="#104">104</a>       scheduler.delete(receiverJob);
+<a name="105" href="#105">105</a>     }
+<a name="106" href="#106">106</a>   }
+<a name="107" href="#107">107</a> 
+<a name="108" href="#108">108</a> 
+<a name="109" href="#109">109</a>   <em class="comment">/*<em class="comment"> (non-Javadoc)</em></em>
+<a name="110" href="#110">110</a> <em class="comment">   * @see org.apache.log4j.plugins.Pauseable#setPaused(boolean)</em>
+<a name="111" href="#111">111</a> <em class="comment">   */</em>
+<a name="112" href="#112">112</a>   <strong>public</strong> <strong>void</strong> setPaused(<strong>boolean</strong> paused) {
+<a name="113" href="#113">113</a>     <strong>this</strong>.paused = paused;
+<a name="114" href="#114">114</a>   }
+<a name="115" href="#115">115</a> 
+<a name="116" href="#116">116</a>   <em class="comment">/*<em class="comment"> (non-Javadoc)</em></em>
+<a name="117" href="#117">117</a> <em class="comment">   * @see org.apache.log4j.plugins.Pauseable#isPaused()</em>
+<a name="118" href="#118">118</a> <em class="comment">   */</em>
+<a name="119" href="#119">119</a>   <strong>public</strong> <strong>boolean</strong> isPaused() {
+<a name="120" href="#120">120</a>     <strong>return</strong> paused;
+<a name="121" href="#121">121</a>   }
+<a name="122" href="#122">122</a> 
+<a name="123" href="#123">123</a>     <em>/**<em>*</em></em>
+<a name="124" href="#124">124</a> <em>     * @{inheritDoc}</em>
+<a name="125" href="#125">125</a> <em>     */</em>
+<a name="126" href="#126">126</a>   <strong>public</strong> <strong>boolean</strong> parseUnrecognizedElement(Element element, Properties props) throws Exception {
+<a name="127" href="#127">127</a>         <strong>if</strong> (<span class="string">"connectionSource"</span>.equals(element.getNodeName())) {
+<a name="128" href="#128">128</a>             Object instance =
+<a name="129" href="#129">129</a>                     DOMConfigurator.parseElement(element, props, ConnectionSource.<strong>class</strong>);
+<a name="130" href="#130">130</a>             <strong>if</strong> (instance instanceof ConnectionSource) {
+<a name="131" href="#131">131</a>                 <a href="../../../../org/apache/log4j/db/ConnectionSource.html">ConnectionSource</a> source = (ConnectionSource) instance;
+<a name="132" href="#132">132</a>                 source.activateOptions();
+<a name="133" href="#133">133</a>                 setConnectionSource(source);
+<a name="134" href="#134">134</a>             }
+<a name="135" href="#135">135</a>             <strong>return</strong> <strong>true</strong>;
+<a name="136" href="#136">136</a>         }
+<a name="137" href="#137">137</a>         <strong>return</strong> false;
+<a name="138" href="#138">138</a>   }
+<a name="139" href="#139">139</a> 
+<a name="140" href="#140">140</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DBReceiver.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DBReceiverJob.html
URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DBReceiverJob.html?view=auto&rev=558362
==============================================================================
--- logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DBReceiverJob.html (added)
+++ logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DBReceiverJob.html Sat Jul 21 10:50:33 2007
@@ -0,0 +1,243 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>DBReceiverJob xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../../../../apidocs/org/apache/log4j/db/DBReceiverJob.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em class="comment">/*</em>
+<a name="2" href="#2">2</a>   <em class="comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</em>
+<a name="3" href="#3">3</a>   <em class="comment"> * contributor license agreements.  See the NOTICE file distributed with</em>
+<a name="4" href="#4">4</a>   <em class="comment"> * this work for additional information regarding copyright ownership.</em>
+<a name="5" href="#5">5</a>   <em class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</em>
+<a name="6" href="#6">6</a>   <em class="comment"> * (the "License"); you may not use this file except in compliance with</em>
+<a name="7" href="#7">7</a>   <em class="comment"> * the License.  You may obtain a copy of the License at</em>
+<a name="8" href="#8">8</a>   <em class="comment"> *</em>
+<a name="9" href="#9">9</a>   <em class="comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="10" href="#10">10</a>  <em class="comment"> *</em>
+<a name="11" href="#11">11</a>  <em class="comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="12" href="#12">12</a>  <em class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a name="13" href="#13">13</a>  <em class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a name="14" href="#14">14</a>  <em class="comment"> * See the License for the specific language governing permissions and</em>
+<a name="15" href="#15">15</a>  <em class="comment"> * limitations under the License.</em>
+<a name="16" href="#16">16</a>  <em class="comment"> */</em>
+<a name="17" href="#17">17</a>  
+<a name="18" href="#18">18</a>  <strong>package</strong> org.apache.log4j.db;
+<a name="19" href="#19">19</a>  
+<a name="20" href="#20">20</a>  <strong>import</strong> org.apache.log4j.Level;
+<a name="21" href="#21">21</a>  <strong>import</strong> org.apache.log4j.Logger;
+<a name="22" href="#22">22</a>  <strong>import</strong> org.apache.log4j.scheduler.Job;
+<a name="23" href="#23">23</a>  <strong>import</strong> org.apache.log4j.spi.ComponentBase;
+<a name="24" href="#24">24</a>  <strong>import</strong> org.apache.log4j.spi.LocationInfo;
+<a name="25" href="#25">25</a>  <strong>import</strong> org.apache.log4j.spi.LoggingEvent;
+<a name="26" href="#26">26</a>  <strong>import</strong> org.apache.log4j.spi.ThrowableInformation;
+<a name="27" href="#27">27</a>  
+<a name="28" href="#28">28</a>  <strong>import</strong> java.sql.Connection;
+<a name="29" href="#29">29</a>  <strong>import</strong> java.sql.PreparedStatement;
+<a name="30" href="#30">30</a>  <strong>import</strong> java.sql.ResultSet;
+<a name="31" href="#31">31</a>  <strong>import</strong> java.sql.SQLException;
+<a name="32" href="#32">32</a>  <strong>import</strong> java.util.Hashtable;
+<a name="33" href="#33">33</a>  <strong>import</strong> java.util.Vector;
+<a name="34" href="#34">34</a>  
+<a name="35" href="#35">35</a>  <em>/**<em>*</em></em>
+<a name="36" href="#36">36</a>  <em> * Actual retrieval of data is made by the instance of DBReceiverJob associated</em>
+<a name="37" href="#37">37</a>  <em> * with DBReceiver.</em>
+<a name="38" href="#38">38</a>  <em> * </em>
+<a name="39" href="#39">39</a>  <em> * @author Ceki G&amp;uuml;lc&amp;uuml;</em>
+<a name="40" href="#40">40</a>  <em> */</em>
+<a name="41" href="#41">41</a>  <strong>class</strong> <a href="../../../../org/apache/log4j/db/DBReceiverJob.html">DBReceiverJob</a> <strong>extends</strong> ComponentBase implements Job {
+<a name="42" href="#42">42</a>  
+<a name="43" href="#43">43</a>    String sqlException = <span class="string">"SELECT trace_line FROM logging_event_exception where event_id=? ORDER by i ASC"</span>;
+<a name="44" href="#44">44</a>    String sqlProperties = <span class="string">"SELECT mapped_key, mapped_value FROM logging_event_property WHERE event_id=?"</span>;
+<a name="45" href="#45">45</a>    String sqlSelect = 
+<a name="46" href="#46">46</a>      <span class="string">"SELECT "</span> +
+<a name="47" href="#47">47</a>      <span class="string">"sequence_number, timestamp, rendered_message, logger_name, "</span> +
+<a name="48" href="#48">48</a>      <span class="string">"level_string, ndc, thread_name, reference_flag, "</span> +
+<a name="49" href="#49">49</a>      <span class="string">"caller_filename, caller_class, caller_method, caller_line, "</span> +
+<a name="50" href="#50">50</a>      <span class="string">"event_id "</span> +
+<a name="51" href="#51">51</a>      <span class="string">"FROM logging_event "</span> +
+<a name="52" href="#52">52</a>      <span class="string">"WHERE event_id > ?  ORDER BY event_id ASC"</span>;
+<a name="53" href="#53">53</a>  
+<a name="54" href="#54">54</a>  
+<a name="55" href="#55">55</a>    <strong>long</strong> lastId = Short.MIN_VALUE;
+<a name="56" href="#56">56</a>  
+<a name="57" href="#57">57</a>    <a href="../../../../org/apache/log4j/db/DBReceiver.html">DBReceiver</a> parentDBReceiver;
+<a name="58" href="#58">58</a>  
+<a name="59" href="#59">59</a>    <a href="../../../../org/apache/log4j/db/DBReceiverJob.html">DBReceiverJob</a>(<a href="../../../../org/apache/log4j/db/DBReceiver.html">DBReceiver</a> parent) {
+<a name="60" href="#60">60</a>      parentDBReceiver = parent;
+<a name="61" href="#61">61</a>    }
+<a name="62" href="#62">62</a>  
+<a name="63" href="#63">63</a>    <strong>public</strong> <strong>void</strong> execute() {
+<a name="64" href="#64">64</a>      getLogger().debug(<span class="string">"DBReceiverJob.execute() called"</span>);
+<a name="65" href="#65">65</a>  
+<a name="66" href="#66">66</a>      Connection connection = <strong>null</strong>;
+<a name="67" href="#67">67</a>  
+<a name="68" href="#68">68</a>      <strong>try</strong> {
+<a name="69" href="#69">69</a>        connection = parentDBReceiver.connectionSource.getConnection();
+<a name="70" href="#70">70</a>        PreparedStatement statement = connection.prepareStatement(sqlSelect);
+<a name="71" href="#71">71</a>        statement.setLong(1, lastId);
+<a name="72" href="#72">72</a>        ResultSet rs = statement.executeQuery();
+<a name="73" href="#73">73</a>        <em class="comment">//rs.beforeFirst();</em>
+<a name="74" href="#74">74</a>  
+<a name="75" href="#75">75</a>        <strong>while</strong> (rs.next()) {
+<a name="76" href="#76">76</a>  	    Logger logger = <strong>null</strong>;
+<a name="77" href="#77">77</a>  	    <strong>long</strong> timeStamp = 0L;
+<a name="78" href="#78">78</a>  	    String level = <strong>null</strong>;
+<a name="79" href="#79">79</a>  	    String threadName = <strong>null</strong>;
+<a name="80" href="#80">80</a>  	    Object message = <strong>null</strong>;
+<a name="81" href="#81">81</a>  	    String ndc = <strong>null</strong>;
+<a name="82" href="#82">82</a>  	    String className = <strong>null</strong>;
+<a name="83" href="#83">83</a>  	    String methodName = <strong>null</strong>;
+<a name="84" href="#84">84</a>  	    String fileName = <strong>null</strong>;
+<a name="85" href="#85">85</a>  	    String lineNumber = <strong>null</strong>;
+<a name="86" href="#86">86</a>  	    Hashtable properties = <strong>new</strong> Hashtable();
+<a name="87" href="#87">87</a>  	
+<a name="88" href="#88">88</a>  
+<a name="89" href="#89">89</a>          <em class="comment">//event.setSequenceNumber(rs.getLong(1));</em>
+<a name="90" href="#90">90</a>          timeStamp = rs.getLong(2);
+<a name="91" href="#91">91</a>          message = rs.getString(3);
+<a name="92" href="#92">92</a>  		logger = Logger.getLogger(rs.getString(4));
+<a name="93" href="#93">93</a>          level = rs.getString(5);
+<a name="94" href="#94">94</a>  		Level levelImpl = Level.toLevel(level.trim());
+<a name="95" href="#95">95</a>  
+<a name="96" href="#96">96</a>          ndc = rs.getString(6);
+<a name="97" href="#97">97</a>          threadName = rs.getString(7);
+<a name="98" href="#98">98</a>  
+<a name="99" href="#99">99</a>          <strong>short</strong> mask = rs.getShort(8);
+<a name="100" href="#100">100</a> 
+<a name="101" href="#101">101</a>         fileName = rs.getString(9);
+<a name="102" href="#102">102</a>         className = rs.getString(10);
+<a name="103" href="#103">103</a>         methodName = rs.getString(11);
+<a name="104" href="#104">104</a>         lineNumber = rs.getString(12).trim();
+<a name="105" href="#105">105</a> 
+<a name="106" href="#106">106</a> 		LocationInfo locationInfo = <strong>null</strong>;
+<a name="107" href="#107">107</a>         <strong>if</strong> (fileName.equals(LocationInfo.NA)) {
+<a name="108" href="#108">108</a>           locationInfo = LocationInfo.NA_LOCATION_INFO;
+<a name="109" href="#109">109</a>         } <strong>else</strong> {
+<a name="110" href="#110">110</a>           locationInfo = <strong>new</strong> LocationInfo(fileName, className,
+<a name="111" href="#111">111</a>               methodName, lineNumber);
+<a name="112" href="#112">112</a>         }
+<a name="113" href="#113">113</a> 
+<a name="114" href="#114">114</a>         <strong>long</strong> id = rs.getLong(13);
+<a name="115" href="#115">115</a>         <em class="comment">//LogLog.info("Received event with id=" + id);</em>
+<a name="116" href="#116">116</a>         lastId = id;
+<a name="117" href="#117">117</a> 
+<a name="118" href="#118">118</a> 		ThrowableInformation throwableInfo = <strong>null</strong>;
+<a name="119" href="#119">119</a>         <strong>if</strong> ((mask &amp; DBHelper.EXCEPTION_EXISTS) != 0) {
+<a name="120" href="#120">120</a>           throwableInfo = getException(connection, id);
+<a name="121" href="#121">121</a>         }
+<a name="122" href="#122">122</a> 
+<a name="123" href="#123">123</a> 	    LoggingEvent event = <strong>new</strong> LoggingEvent(logger.getName(),
+<a name="124" href="#124">124</a> 	            logger, timeStamp, levelImpl, message,
+<a name="125" href="#125">125</a> 	            threadName,
+<a name="126" href="#126">126</a> 	            throwableInfo,
+<a name="127" href="#127">127</a> 	            ndc,
+<a name="128" href="#128">128</a> 	            locationInfo,
+<a name="129" href="#129">129</a> 	            properties);
+<a name="130" href="#130">130</a> 
+<a name="131" href="#131">131</a> 
+<a name="132" href="#132">132</a>         <em class="comment">// Scott asked for this info to be</em>
+<a name="133" href="#133">133</a>         event.setProperty(<span class="string">"log4jid"</span>, Long.toString(id));
+<a name="134" href="#134">134</a> 
+<a name="135" href="#135">135</a>         <strong>if</strong> ((mask &amp; DBHelper.PROPERTIES_EXIST) != 0) {
+<a name="136" href="#136">136</a>           getProperties(connection, id, event);
+<a name="137" href="#137">137</a>         }
+<a name="138" href="#138">138</a> 
+<a name="139" href="#139">139</a> 
+<a name="140" href="#140">140</a> 
+<a name="141" href="#141">141</a> 
+<a name="142" href="#142">142</a>         <strong>if</strong> (!parentDBReceiver.isPaused()) {
+<a name="143" href="#143">143</a>           parentDBReceiver.doPost(event);
+<a name="144" href="#144">144</a>         }
+<a name="145" href="#145">145</a>       } <em class="comment">// while</em>
+<a name="146" href="#146">146</a>       statement.close();
+<a name="147" href="#147">147</a>       statement = <strong>null</strong>;
+<a name="148" href="#148">148</a>     } <strong>catch</strong> (SQLException sqle) {
+<a name="149" href="#149">149</a>       getLogger().error(<span class="string">"Problem receiving events"</span>, sqle);
+<a name="150" href="#150">150</a>     } <strong>finally</strong> {
+<a name="151" href="#151">151</a>       closeConnection(connection);
+<a name="152" href="#152">152</a>     }
+<a name="153" href="#153">153</a>   }
+<a name="154" href="#154">154</a> 
+<a name="155" href="#155">155</a>   <strong>void</strong> closeConnection(Connection connection) {
+<a name="156" href="#156">156</a>     <strong>if</strong> (connection != <strong>null</strong>) {
+<a name="157" href="#157">157</a>       <strong>try</strong> {
+<a name="158" href="#158">158</a>         <em class="comment">//LogLog.warn("closing the connection. ", new Exception("x"));</em>
+<a name="159" href="#159">159</a>         connection.close();
+<a name="160" href="#160">160</a>       } <strong>catch</strong> (SQLException sqle) {
+<a name="161" href="#161">161</a>         <em class="comment">// nothing we can do here</em>
+<a name="162" href="#162">162</a>       }
+<a name="163" href="#163">163</a>     }
+<a name="164" href="#164">164</a>   }
+<a name="165" href="#165">165</a> 
+<a name="166" href="#166">166</a>   <em>/**<em>*</em></em>
+<a name="167" href="#167">167</a> <em>   * Retrieve the event properties from the logging_event_property table.</em>
+<a name="168" href="#168">168</a> <em>   * </em>
+<a name="169" href="#169">169</a> <em>   * @param connection</em>
+<a name="170" href="#170">170</a> <em>   * @param id</em>
+<a name="171" href="#171">171</a> <em>   * @param event</em>
+<a name="172" href="#172">172</a> <em>   * @throws SQLException</em>
+<a name="173" href="#173">173</a> <em>   */</em>
+<a name="174" href="#174">174</a>   <strong>void</strong> getProperties(Connection connection, <strong>long</strong> id, LoggingEvent event)
+<a name="175" href="#175">175</a>       throws SQLException {
+<a name="176" href="#176">176</a> 
+<a name="177" href="#177">177</a>     PreparedStatement statement = connection.prepareStatement(sqlProperties);
+<a name="178" href="#178">178</a>     <strong>try</strong> {
+<a name="179" href="#179">179</a>       statement.setLong(1, id);
+<a name="180" href="#180">180</a>       ResultSet rs = statement.executeQuery();
+<a name="181" href="#181">181</a> 
+<a name="182" href="#182">182</a>       <strong>while</strong> (rs.next()) {
+<a name="183" href="#183">183</a>         String key = rs.getString(1);
+<a name="184" href="#184">184</a>         String value = rs.getString(2);
+<a name="185" href="#185">185</a>         event.setProperty(key, value);
+<a name="186" href="#186">186</a>       }
+<a name="187" href="#187">187</a>     } <strong>finally</strong> {
+<a name="188" href="#188">188</a>       statement.close();
+<a name="189" href="#189">189</a>     }
+<a name="190" href="#190">190</a>   }
+<a name="191" href="#191">191</a> 
+<a name="192" href="#192">192</a>   <em>/**<em>*</em></em>
+<a name="193" href="#193">193</a> <em>   * Retrieve the exception string representation from the</em>
+<a name="194" href="#194">194</a> <em>   * logging_event_exception table.</em>
+<a name="195" href="#195">195</a> <em>   * </em>
+<a name="196" href="#196">196</a> <em>   * @param connection</em>
+<a name="197" href="#197">197</a> <em>   * @param id</em>
+<a name="198" href="#198">198</a> <em>   * @throws SQLException</em>
+<a name="199" href="#199">199</a> <em>   */</em>
+<a name="200" href="#200">200</a>   ThrowableInformation getException(Connection connection, <strong>long</strong> id)
+<a name="201" href="#201">201</a>       throws SQLException {
+<a name="202" href="#202">202</a> 
+<a name="203" href="#203">203</a>     PreparedStatement statement = <strong>null</strong>;
+<a name="204" href="#204">204</a> 
+<a name="205" href="#205">205</a>     <strong>try</strong> {
+<a name="206" href="#206">206</a>       statement = connection.prepareStatement(sqlException);
+<a name="207" href="#207">207</a>       statement.setLong(1, id);
+<a name="208" href="#208">208</a>       ResultSet rs = statement.executeQuery();
+<a name="209" href="#209">209</a> 
+<a name="210" href="#210">210</a>       Vector v = <strong>new</strong> Vector();
+<a name="211" href="#211">211</a> 
+<a name="212" href="#212">212</a>       <strong>while</strong> (rs.next()) {
+<a name="213" href="#213">213</a>         <em class="comment">//int i = rs.getShort(1);</em>
+<a name="214" href="#214">214</a>         v.add(rs.getString(1));
+<a name="215" href="#215">215</a>       }
+<a name="216" href="#216">216</a> 
+<a name="217" href="#217">217</a>       <strong>int</strong> len = v.size();
+<a name="218" href="#218">218</a>       String[] strRep = <strong>new</strong> String[len];
+<a name="219" href="#219">219</a>       <strong>for</strong> (<strong>int</strong> i = 0; i &lt; len; i++) {
+<a name="220" href="#220">220</a>         strRep[i] = (String) v.get(i);
+<a name="221" href="#221">221</a>       }
+<a name="222" href="#222">222</a>       <em class="comment">// we've filled strRep, we now attach it to the event</em>
+<a name="223" href="#223">223</a>       <strong>return</strong> <strong>new</strong> ThrowableInformation(strRep);
+<a name="224" href="#224">224</a>     } <strong>finally</strong> {
+<a name="225" href="#225">225</a>       <strong>if</strong> (statement != <strong>null</strong>) {
+<a name="226" href="#226">226</a>         statement.close();
+<a name="227" href="#227">227</a>       }
+<a name="228" href="#228">228</a>     }
+<a name="229" href="#229">229</a>   }
+<a name="230" href="#230">230</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DBReceiverJob.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DataSourceConnectionSource.html
URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DataSourceConnectionSource.html?view=auto&rev=558362
==============================================================================
--- logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DataSourceConnectionSource.html (added)
+++ logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DataSourceConnectionSource.html Sat Jul 21 10:50:33 2007
@@ -0,0 +1,118 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>DataSourceConnectionSource xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../../../../apidocs/org/apache/log4j/db/DataSourceConnectionSource.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em class="comment">/*</em>
+<a name="2" href="#2">2</a>   <em class="comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</em>
+<a name="3" href="#3">3</a>   <em class="comment"> * contributor license agreements.  See the NOTICE file distributed with</em>
+<a name="4" href="#4">4</a>   <em class="comment"> * this work for additional information regarding copyright ownership.</em>
+<a name="5" href="#5">5</a>   <em class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</em>
+<a name="6" href="#6">6</a>   <em class="comment"> * (the "License"); you may not use this file except in compliance with</em>
+<a name="7" href="#7">7</a>   <em class="comment"> * the License.  You may obtain a copy of the License at</em>
+<a name="8" href="#8">8</a>   <em class="comment"> *</em>
+<a name="9" href="#9">9</a>   <em class="comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="10" href="#10">10</a>  <em class="comment"> *</em>
+<a name="11" href="#11">11</a>  <em class="comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="12" href="#12">12</a>  <em class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a name="13" href="#13">13</a>  <em class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a name="14" href="#14">14</a>  <em class="comment"> * See the License for the specific language governing permissions and</em>
+<a name="15" href="#15">15</a>  <em class="comment"> * limitations under the License.</em>
+<a name="16" href="#16">16</a>  <em class="comment"> */</em>
+<a name="17" href="#17">17</a>  
+<a name="18" href="#18">18</a>  <strong>package</strong> org.apache.log4j.db;
+<a name="19" href="#19">19</a>  
+<a name="20" href="#20">20</a>  
+<a name="21" href="#21">21</a>  <strong>import</strong> org.apache.log4j.xml.DOMConfigurator;
+<a name="22" href="#22">22</a>  <strong>import</strong> org.apache.log4j.xml.UnrecognizedElementHandler;
+<a name="23" href="#23">23</a>  <strong>import</strong> org.w3c.dom.Element;
+<a name="24" href="#24">24</a>  
+<a name="25" href="#25">25</a>  <strong>import</strong> javax.sql.DataSource;
+<a name="26" href="#26">26</a>  <strong>import</strong> java.sql.Connection;
+<a name="27" href="#27">27</a>  <strong>import</strong> java.sql.SQLException;
+<a name="28" href="#28">28</a>  <strong>import</strong> java.util.Properties;
+<a name="29" href="#29">29</a>  
+<a name="30" href="#30">30</a>  
+<a name="31" href="#31">31</a>  <em>/**<em>*</em></em>
+<a name="32" href="#32">32</a>  <em> *  The DataSourceConnectionSource is an implementation of {@link ConnectionSource}</em>
+<a name="33" href="#33">33</a>  <em> *  that obtains the Connection in the recommended JDBC manner based on</em>
+<a name="34" href="#34">34</a>  <em> *  a {@link javax.sql.DataSource DataSource}.</em>
+<a name="35" href="#35">35</a>  <em> *  &lt;p></em>
+<a name="36" href="#36">36</a>  <em> *</em>
+<a name="37" href="#37">37</a>  <em> *  @author Ray DeCampo</em>
+<a name="38" href="#38">38</a>  <em> *  @author Ceki G&amp;uuml;lc&amp;uuml;</em>
+<a name="39" href="#39">39</a>  <em> */</em>
+<a name="40" href="#40">40</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../org/apache/log4j/db/DataSourceConnectionSource.html">DataSourceConnectionSource</a> <strong>extends</strong> <a href="../../../../org/apache/log4j/db/ConnectionSourceSkeleton.html">ConnectionSourceSkeleton</a>
+<a name="41" href="#41">41</a>          implements UnrecognizedElementHandler {
+<a name="42" href="#42">42</a>  
+<a name="43" href="#43">43</a>    <strong>private</strong> DataSource dataSource;
+<a name="44" href="#44">44</a>  
+<a name="45" href="#45">45</a>    
+<a name="46" href="#46">46</a>    <strong>public</strong> <strong>void</strong> activateOptions() {
+<a name="47" href="#47">47</a>      <em class="comment">//LogLog.debug("**********DataSourceConnectionSource.activateOptions called");</em>
+<a name="48" href="#48">48</a>      <strong>if</strong> (dataSource == <strong>null</strong>) {
+<a name="49" href="#49">49</a>        getLogger().warn(<span class="string">"WARNING: No data source specified"</span>);
+<a name="50" href="#50">50</a>      } <strong>else</strong> {
+<a name="51" href="#51">51</a>        Connection connection = <strong>null</strong>;
+<a name="52" href="#52">52</a>        <strong>try</strong> {
+<a name="53" href="#53">53</a>          connection = getConnection();
+<a name="54" href="#54">54</a>        } <strong>catch</strong>(SQLException se) {
+<a name="55" href="#55">55</a>          getLogger().warn(<span class="string">"Could not get a connection to discover the dialect to use."</span>, se);
+<a name="56" href="#56">56</a>        }
+<a name="57" href="#57">57</a>        <strong>if</strong>(connection != <strong>null</strong>) {
+<a name="58" href="#58">58</a>          discoverConnnectionProperties();
+<a name="59" href="#59">59</a>        } 
+<a name="60" href="#60">60</a>        <strong>if</strong>(!supportsGetGeneratedKeys() &amp;&amp; getSQLDialectCode() == ConnectionSource.UNKNOWN_DIALECT) {
+<a name="61" href="#61">61</a>          getLogger().warn(<span class="string">"Connection does not support GetGeneratedKey method and could not discover the dialect."</span>);
+<a name="62" href="#62">62</a>        }
+<a name="63" href="#63">63</a>      }
+<a name="64" href="#64">64</a>    }
+<a name="65" href="#65">65</a>  
+<a name="66" href="#66">66</a>    <em>/**<em>*</em></em>
+<a name="67" href="#67">67</a>  <em>   * @see org.apache.log4j.db.ConnectionSource#getConnection()</em>
+<a name="68" href="#68">68</a>  <em>   */</em>
+<a name="69" href="#69">69</a>    <strong>public</strong> Connection getConnection() throws SQLException {
+<a name="70" href="#70">70</a>      <strong>if</strong> (dataSource == <strong>null</strong>) {
+<a name="71" href="#71">71</a>        getLogger().error(<span class="string">"WARNING: No data source specified"</span>);
+<a name="72" href="#72">72</a>        <strong>return</strong> <strong>null</strong>;
+<a name="73" href="#73">73</a>      }
+<a name="74" href="#74">74</a>  
+<a name="75" href="#75">75</a>      <strong>if</strong> (getUser() == <strong>null</strong>) {
+<a name="76" href="#76">76</a>        <strong>return</strong> dataSource.getConnection();
+<a name="77" href="#77">77</a>      } <strong>else</strong> {
+<a name="78" href="#78">78</a>        <strong>return</strong> dataSource.getConnection(getUser(), getPassword());
+<a name="79" href="#79">79</a>      }
+<a name="80" href="#80">80</a>    }
+<a name="81" href="#81">81</a>  
+<a name="82" href="#82">82</a>    <strong>public</strong> DataSource getDataSource() {
+<a name="83" href="#83">83</a>      <strong>return</strong> dataSource;
+<a name="84" href="#84">84</a>    }
+<a name="85" href="#85">85</a>  
+<a name="86" href="#86">86</a>    <strong>public</strong> <strong>void</strong> setDataSource(DataSource dataSource) {
+<a name="87" href="#87">87</a>      <strong>this</strong>.dataSource = dataSource;
+<a name="88" href="#88">88</a>    }
+<a name="89" href="#89">89</a>  
+<a name="90" href="#90">90</a>      <em>/**<em>*</em></em>
+<a name="91" href="#91">91</a>  <em>     * @{inheritDoc}</em>
+<a name="92" href="#92">92</a>  <em>     */</em>
+<a name="93" href="#93">93</a>    <strong>public</strong> <strong>boolean</strong> parseUnrecognizedElement(Element element, Properties props) throws Exception {
+<a name="94" href="#94">94</a>          <strong>if</strong> (<span class="string">"dataSource"</span>.equals(element.getNodeName())) {
+<a name="95" href="#95">95</a>              Object instance =
+<a name="96" href="#96">96</a>                      DOMConfigurator.parseElement(element, props, DataSource.<strong>class</strong>);
+<a name="97" href="#97">97</a>              <strong>if</strong> (instance instanceof DataSource) {
+<a name="98" href="#98">98</a>                 setDataSource((DataSource) instance);
+<a name="99" href="#99">99</a>              }
+<a name="100" href="#100">100</a>             <strong>return</strong> <strong>true</strong>;
+<a name="101" href="#101">101</a>         }
+<a name="102" href="#102">102</a>         <strong>return</strong> false;
+<a name="103" href="#103">103</a>   }
+<a name="104" href="#104">104</a> 
+<a name="105" href="#105">105</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DataSourceConnectionSource.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DriverManagerConnectionSource.html
URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DriverManagerConnectionSource.html?view=auto&rev=558362
==============================================================================
--- logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DriverManagerConnectionSource.html (added)
+++ logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DriverManagerConnectionSource.html Sat Jul 21 10:50:33 2007
@@ -0,0 +1,146 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>DriverManagerConnectionSource xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../../../../apidocs/org/apache/log4j/db/DriverManagerConnectionSource.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em class="comment">/*</em>
+<a name="2" href="#2">2</a>   <em class="comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</em>
+<a name="3" href="#3">3</a>   <em class="comment"> * contributor license agreements.  See the NOTICE file distributed with</em>
+<a name="4" href="#4">4</a>   <em class="comment"> * this work for additional information regarding copyright ownership.</em>
+<a name="5" href="#5">5</a>   <em class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</em>
+<a name="6" href="#6">6</a>   <em class="comment"> * (the "License"); you may not use this file except in compliance with</em>
+<a name="7" href="#7">7</a>   <em class="comment"> * the License.  You may obtain a copy of the License at</em>
+<a name="8" href="#8">8</a>   <em class="comment"> *</em>
+<a name="9" href="#9">9</a>   <em class="comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="10" href="#10">10</a>  <em class="comment"> *</em>
+<a name="11" href="#11">11</a>  <em class="comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="12" href="#12">12</a>  <em class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a name="13" href="#13">13</a>  <em class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a name="14" href="#14">14</a>  <em class="comment"> * See the License for the specific language governing permissions and</em>
+<a name="15" href="#15">15</a>  <em class="comment"> * limitations under the License.</em>
+<a name="16" href="#16">16</a>  <em class="comment"> */</em>
+<a name="17" href="#17">17</a>  
+<a name="18" href="#18">18</a>  <strong>package</strong> org.apache.log4j.db;
+<a name="19" href="#19">19</a>  
+<a name="20" href="#20">20</a>  <strong>import</strong> java.sql.Connection;
+<a name="21" href="#21">21</a>  <strong>import</strong> java.sql.DriverManager;
+<a name="22" href="#22">22</a>  <strong>import</strong> java.sql.SQLException;
+<a name="23" href="#23">23</a>  
+<a name="24" href="#24">24</a>  
+<a name="25" href="#25">25</a>  <em>/**<em>*</em></em>
+<a name="26" href="#26">26</a>  <em> *  The DriverManagerConnectionSource is an implementation of {@link ConnectionSource}</em>
+<a name="27" href="#27">27</a>  <em> *  that obtains the Connection in the traditional JDBC manner based on the</em>
+<a name="28" href="#28">28</a>  <em> *  connection URL.</em>
+<a name="29" href="#29">29</a>  <em> *  &lt;p></em>
+<a name="30" href="#30">30</a>  <em> *  Note that this class will establish a new Connection for each call to</em>
+<a name="31" href="#31">31</a>  <em> *  {@link #getConnection()}.  It is recommended that you either use a JDBC</em>
+<a name="32" href="#32">32</a>  <em> *  driver that natively supported Connection pooling or that you create</em>
+<a name="33" href="#33">33</a>  <em> *  your own implementation of {@link ConnectionSource} that taps into whatever</em>
+<a name="34" href="#34">34</a>  <em> *  pooling mechanism you are already using.  (If you have access to a JNDI</em>
+<a name="35" href="#35">35</a>  <em> *  implementation that supports {@link javax.sql.DataSource}s, e.g. within</em>
+<a name="36" href="#36">36</a>  <em> *  a J2EE application server, see {@link JNDIConnectionSource}).  See</em>
+<a name="37" href="#37">37</a>  <em> *  &lt;a href="#dbcp">below&lt;/a> for a configuration example that uses the</em>
+<a name="38" href="#38">38</a>  <em> *  &lt;a href="<a href="http://jakarta.apache.org/commons/dbcp/index.html" target="alexandria_uri">http://jakarta.apache.org/commons/dbcp/index.html</a>">commons-dbcp&lt;/a></em>
+<a name="39" href="#39">39</a>  <em> *  package from Apache.</em>
+<a name="40" href="#40">40</a>  <em> *  &lt;p></em>
+<a name="41" href="#41">41</a>  <em> *  Sample configuration:&lt;br></em>
+<a name="42" href="#42">42</a>  <em> *  &lt;pre></em>
+<a name="43" href="#43">43</a>  <em> *     &amp;lt;connectionSource class="org.apache.log4j.jdbc.DriverManagerConnectionSource"&amp;gt;</em>
+<a name="44" href="#44">44</a>  <em> *        &amp;lt;param name="driver" value="com.mysql.jdbc.Driver" /&amp;gt;</em>
+<a name="45" href="#45">45</a>  <em> *        &amp;lt;param name="url" value="jdbc:mysql://localhost:3306/mydb" /&amp;gt;</em>
+<a name="46" href="#46">46</a>  <em> *        &amp;lt;param name="username" value="myUser" /&amp;gt;</em>
+<a name="47" href="#47">47</a>  <em> *        &amp;lt;param name="password" value="myPassword" /&amp;gt;</em>
+<a name="48" href="#48">48</a>  <em> *     &amp;lt;/connectionSource&amp;gt;</em>
+<a name="49" href="#49">49</a>  <em> *  &lt;/pre></em>
+<a name="50" href="#50">50</a>  <em> *  &lt;p></em>
+<a name="51" href="#51">51</a>  <em> *  &lt;a name="dbcp">If&lt;/a> you do not have another connection pooling mechanism</em>
+<a name="52" href="#52">52</a>  <em> *  built into your application, you can use  the</em>
+<a name="53" href="#53">53</a>  <em> *  &lt;a href="<a href="http://jakarta.apache.org/commons/dbcp/index.html" target="alexandria_uri">http://jakarta.apache.org/commons/dbcp/index.html</a>">commons-dbcp&lt;/a></em>
+<a name="54" href="#54">54</a>  <em> *  package from Apache:&lt;br></em>
+<a name="55" href="#55">55</a>  <em> *  &lt;pre></em>
+<a name="56" href="#56">56</a>  <em> *     &amp;lt;connectionSource class="org.apache.log4j.jdbc.DriverManagerConnectionSource"&amp;gt;</em>
+<a name="57" href="#57">57</a>  <em> *        &amp;lt;param name="driver" value="org.apache.commons.dbcp.PoolingDriver" /&amp;gt;</em>
+<a name="58" href="#58">58</a>  <em> *        &amp;lt;param name="url" value="jdbc:apache:commons:dbcp:/myPoolingDriver" /&amp;gt;</em>
+<a name="59" href="#59">59</a>  <em> *     &amp;lt;/connectionSource&amp;gt;</em>
+<a name="60" href="#60">60</a>  <em> *  &lt;/pre></em>
+<a name="61" href="#61">61</a>  <em> *  Then the configuration information for the commons-dbcp package goes into</em>
+<a name="62" href="#62">62</a>  <em> *  the file myPoolingDriver.jocl and is placed in the classpath.  See the</em>
+<a name="63" href="#63">63</a>  <em> *  &lt;a href="<a href="http://jakarta.apache.org/commons/dbcp/index.html" target="alexandria_uri">http://jakarta.apache.org/commons/dbcp/index.html</a>">commons-dbcp&lt;/a></em>
+<a name="64" href="#64">64</a>  <em> *  documentation for details.</em>
+<a name="65" href="#65">65</a>  <em> *</em>
+<a name="66" href="#66">66</a>  <em> *  @author &lt;a href="<a href="mailto:rdecampo@twcny.rr.com" target="alexandria_uri">mailto:rdecampo@twcny.rr.com</a>">Ray DeCampo&lt;/a></em>
+<a name="67" href="#67">67</a>  <em> */</em>
+<a name="68" href="#68">68</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../org/apache/log4j/db/DriverManagerConnectionSource.html">DriverManagerConnectionSource</a> <strong>extends</strong> <a href="../../../../org/apache/log4j/db/ConnectionSourceSkeleton.html">ConnectionSourceSkeleton</a> {
+<a name="69" href="#69">69</a>    <strong>private</strong> String driverClass = <strong>null</strong>;
+<a name="70" href="#70">70</a>    <strong>private</strong> String url = <strong>null</strong>;
+<a name="71" href="#71">71</a>  
+<a name="72" href="#72">72</a>    <strong>public</strong> <strong>void</strong> activateOptions() {
+<a name="73" href="#73">73</a>      <strong>try</strong> {
+<a name="74" href="#74">74</a>        <strong>if</strong> (driverClass != <strong>null</strong>) {
+<a name="75" href="#75">75</a>          Class.forName(driverClass);
+<a name="76" href="#76">76</a>          discoverConnnectionProperties();
+<a name="77" href="#77">77</a>        } <strong>else</strong> {
+<a name="78" href="#78">78</a>          getLogger().error(
+<a name="79" href="#79">79</a>            <span class="string">"WARNING: No JDBC driver specified for log4j DriverManagerConnectionSource."</span>);
+<a name="80" href="#80">80</a>        }
+<a name="81" href="#81">81</a>      } <strong>catch</strong> (<strong>final</strong> ClassNotFoundException cnfe) {
+<a name="82" href="#82">82</a>       getLogger().error(<span class="string">"Could not load JDBC driver class: "</span> + driverClass, cnfe);
+<a name="83" href="#83">83</a>      }
+<a name="84" href="#84">84</a>    }
+<a name="85" href="#85">85</a>  
+<a name="86" href="#86">86</a>  
+<a name="87" href="#87">87</a>    <em>/**<em>*</em></em>
+<a name="88" href="#88">88</a>  <em>   * @see org.apache.log4j.db.ConnectionSource#getConnection()</em>
+<a name="89" href="#89">89</a>  <em>   */</em>
+<a name="90" href="#90">90</a>    <strong>public</strong> Connection getConnection() throws SQLException {
+<a name="91" href="#91">91</a>      <strong>if</strong> (getUser() == <strong>null</strong>) {
+<a name="92" href="#92">92</a>        <strong>return</strong> DriverManager.getConnection(url);
+<a name="93" href="#93">93</a>      } <strong>else</strong> {
+<a name="94" href="#94">94</a>        <strong>return</strong> DriverManager.getConnection(url, getUser(), getPassword());
+<a name="95" href="#95">95</a>      }
+<a name="96" href="#96">96</a>    }
+<a name="97" href="#97">97</a>  
+<a name="98" href="#98">98</a>  
+<a name="99" href="#99">99</a>    <em>/**<em>*</em></em>
+<a name="100" href="#100">100</a> <em>   * Returns the url.</em>
+<a name="101" href="#101">101</a> <em>   * @return String</em>
+<a name="102" href="#102">102</a> <em>   */</em>
+<a name="103" href="#103">103</a>   <strong>public</strong> String getUrl() {
+<a name="104" href="#104">104</a>     <strong>return</strong> url;
+<a name="105" href="#105">105</a>   }
+<a name="106" href="#106">106</a> 
+<a name="107" href="#107">107</a> 
+<a name="108" href="#108">108</a>   <em>/**<em>*</em></em>
+<a name="109" href="#109">109</a> <em>   * Sets the url.</em>
+<a name="110" href="#110">110</a> <em>   * @param url The url to set</em>
+<a name="111" href="#111">111</a> <em>   */</em>
+<a name="112" href="#112">112</a>   <strong>public</strong> <strong>void</strong> setUrl(String url) {
+<a name="113" href="#113">113</a>     <strong>this</strong>.url = url;
+<a name="114" href="#114">114</a>   }
+<a name="115" href="#115">115</a> 
+<a name="116" href="#116">116</a> 
+<a name="117" href="#117">117</a>   <em>/**<em>*</em></em>
+<a name="118" href="#118">118</a> <em>   * Returns the name of the driver class.</em>
+<a name="119" href="#119">119</a> <em>   * @return String</em>
+<a name="120" href="#120">120</a> <em>   */</em>
+<a name="121" href="#121">121</a>   <strong>public</strong> String getDriverClass() {
+<a name="122" href="#122">122</a>     <strong>return</strong> driverClass;
+<a name="123" href="#123">123</a>   }
+<a name="124" href="#124">124</a> 
+<a name="125" href="#125">125</a> 
+<a name="126" href="#126">126</a>   <em>/**<em>*</em></em>
+<a name="127" href="#127">127</a> <em>   * Sets the driver class.</em>
+<a name="128" href="#128">128</a> <em>   * @param driverClass The driver class to set</em>
+<a name="129" href="#129">129</a> <em>   */</em>
+<a name="130" href="#130">130</a>   <strong>public</strong> <strong>void</strong> setDriverClass(String driverClass) {
+<a name="131" href="#131">131</a>     <strong>this</strong>.driverClass = driverClass;
+<a name="132" href="#132">132</a>   }
+<a name="133" href="#133">133</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/DriverManagerConnectionSource.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/JNDIConnectionSource.html
URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/JNDIConnectionSource.html?view=auto&rev=558362
==============================================================================
--- logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/JNDIConnectionSource.html (added)
+++ logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/JNDIConnectionSource.html Sat Jul 21 10:50:33 2007
@@ -0,0 +1,156 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>JNDIConnectionSource xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../../../../apidocs/org/apache/log4j/db/JNDIConnectionSource.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em class="comment">/*</em>
+<a name="2" href="#2">2</a>   <em class="comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</em>
+<a name="3" href="#3">3</a>   <em class="comment"> * contributor license agreements.  See the NOTICE file distributed with</em>
+<a name="4" href="#4">4</a>   <em class="comment"> * this work for additional information regarding copyright ownership.</em>
+<a name="5" href="#5">5</a>   <em class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</em>
+<a name="6" href="#6">6</a>   <em class="comment"> * (the "License"); you may not use this file except in compliance with</em>
+<a name="7" href="#7">7</a>   <em class="comment"> * the License.  You may obtain a copy of the License at</em>
+<a name="8" href="#8">8</a>   <em class="comment"> *</em>
+<a name="9" href="#9">9</a>   <em class="comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="10" href="#10">10</a>  <em class="comment"> *</em>
+<a name="11" href="#11">11</a>  <em class="comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="12" href="#12">12</a>  <em class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a name="13" href="#13">13</a>  <em class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a name="14" href="#14">14</a>  <em class="comment"> * See the License for the specific language governing permissions and</em>
+<a name="15" href="#15">15</a>  <em class="comment"> * limitations under the License.</em>
+<a name="16" href="#16">16</a>  <em class="comment"> */</em>
+<a name="17" href="#17">17</a>  <strong>package</strong> org.apache.log4j.db;
+<a name="18" href="#18">18</a>  
+<a name="19" href="#19">19</a>  <strong>import</strong> java.sql.Connection;
+<a name="20" href="#20">20</a>  <strong>import</strong> java.sql.SQLException;
+<a name="21" href="#21">21</a>  
+<a name="22" href="#22">22</a>  <strong>import</strong> javax.naming.Context;
+<a name="23" href="#23">23</a>  <strong>import</strong> javax.naming.InitialContext;
+<a name="24" href="#24">24</a>  <strong>import</strong> javax.naming.NamingException;
+<a name="25" href="#25">25</a>  
+<a name="26" href="#26">26</a>  <em class="comment">// PortableRemoteObject was introduced in JDK 1.3. We won't use it.</em>
+<a name="27" href="#27">27</a>  <em class="comment">// import javax.rmi.PortableRemoteObject;</em>
+<a name="28" href="#28">28</a>  <strong>import</strong> javax.sql.DataSource;
+<a name="29" href="#29">29</a>  
+<a name="30" href="#30">30</a>  
+<a name="31" href="#31">31</a>  <em>/**<em>*</em></em>
+<a name="32" href="#32">32</a>  <em> *  The &lt;id>JNDIConnectionSource&lt;/id> is an implementation of</em>
+<a name="33" href="#33">33</a>  <em> *  {@link ConnectionSource} that obtains a {@link javax.sql.DataSource} from a</em>
+<a name="34" href="#34">34</a>  <em> *  JNDI provider and uses it to obtain a {@link java.sql.Connection}.  It is</em>
+<a name="35" href="#35">35</a>  <em> *  primarily designed to be used inside of J2EE application servers or</em>
+<a name="36" href="#36">36</a>  <em> *  application server clients, assuming the application server supports remote</em>
+<a name="37" href="#37">37</a>  <em> *  access of {@link javax.sql.DataSource}s.  In this way one can take</em>
+<a name="38" href="#38">38</a>  <em> *  advantage of  connection pooling and whatever other goodies the application</em>
+<a name="39" href="#39">39</a>  <em> *  server provides.</em>
+<a name="40" href="#40">40</a>  <em> *  &lt;p></em>
+<a name="41" href="#41">41</a>  <em> *  Sample configuration:&lt;br></em>
+<a name="42" href="#42">42</a>  <em> *  &lt;pre></em>
+<a name="43" href="#43">43</a>  <em> *    &amp;lt;connectionSource class="org.apache.log4j.jdbc.JNDIConnectionSource"&amp;gt;</em>
+<a name="44" href="#44">44</a>  <em> *        &amp;lt;param name="jndiLocation" value="jdbc/MySQLDS" /&amp;gt;</em>
+<a name="45" href="#45">45</a>  <em> *    &amp;lt;/connectionSource&amp;gt;</em>
+<a name="46" href="#46">46</a>  <em> *  &lt;/pre></em>
+<a name="47" href="#47">47</a>  <em> *  &lt;p></em>
+<a name="48" href="#48">48</a>  <em> *  Sample configuration (with username and password):&lt;br></em>
+<a name="49" href="#49">49</a>  <em> *  &lt;pre></em>
+<a name="50" href="#50">50</a>  <em> *    &amp;lt;connectionSource class="org.apache.log4j.jdbc.JNDIConnectionSource"&amp;gt;</em>
+<a name="51" href="#51">51</a>  <em> *        &amp;lt;param name="jndiLocation" value="jdbc/MySQLDS" /&amp;gt;</em>
+<a name="52" href="#52">52</a>  <em> *        &amp;lt;param name="username" value="myUser" /&amp;gt;</em>
+<a name="53" href="#53">53</a>  <em> *        &amp;lt;param name="password" value="myPassword" /&amp;gt;</em>
+<a name="54" href="#54">54</a>  <em> *    &amp;lt;/connectionSource&amp;gt;</em>
+<a name="55" href="#55">55</a>  <em> *  &lt;/pre></em>
+<a name="56" href="#56">56</a>  <em> *  &lt;p></em>
+<a name="57" href="#57">57</a>  <em> *  Note that this class will obtain an {@link javax.naming.InitialContext}</em>
+<a name="58" href="#58">58</a>  <em> *  using the no-argument constructor.  This will usually work when executing</em>
+<a name="59" href="#59">59</a>  <em> *  within a J2EE environment.  When outside the J2EE environment, make sure</em>
+<a name="60" href="#60">60</a>  <em> *  that you provide a jndi.properties file as described by your JNDI</em>
+<a name="61" href="#61">61</a>  <em> *  provider's documentation.</em>
+<a name="62" href="#62">62</a>  <em> *</em>
+<a name="63" href="#63">63</a>  <em> *  @author &lt;a href="<a href="mailto:rdecampo@twcny.rr.com" target="alexandria_uri">mailto:rdecampo@twcny.rr.com</a>">Ray DeCampo&lt;/a></em>
+<a name="64" href="#64">64</a>  <em> */</em>
+<a name="65" href="#65">65</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../org/apache/log4j/db/JNDIConnectionSource.html">JNDIConnectionSource</a>
+<a name="66" href="#66">66</a>         <strong>extends</strong> <a href="../../../../org/apache/log4j/db/ConnectionSourceSkeleton.html">ConnectionSourceSkeleton</a> {
+<a name="67" href="#67">67</a>    <strong>private</strong> String jndiLocation = <strong>null</strong>;
+<a name="68" href="#68">68</a>    <strong>private</strong> DataSource dataSource = <strong>null</strong>;
+<a name="69" href="#69">69</a>  
+<a name="70" href="#70">70</a>    <em>/**<em>*</em></em>
+<a name="71" href="#71">71</a>  <em>   * @see org.apache.log4j.spi.OptionHandler#activateOptions()</em>
+<a name="72" href="#72">72</a>  <em>   */</em>
+<a name="73" href="#73">73</a>    <strong>public</strong> <strong>void</strong> activateOptions() {
+<a name="74" href="#74">74</a>      <strong>if</strong> (jndiLocation == <strong>null</strong>) {
+<a name="75" href="#75">75</a>        getLogger().error(<span class="string">"No JNDI location specified for JNDIConnectionSource."</span>);
+<a name="76" href="#76">76</a>      }
+<a name="77" href="#77">77</a>      
+<a name="78" href="#78">78</a>      discoverConnnectionProperties();
+<a name="79" href="#79">79</a>  
+<a name="80" href="#80">80</a>    }
+<a name="81" href="#81">81</a>    
+<a name="82" href="#82">82</a>    <em>/**<em>*</em></em>
+<a name="83" href="#83">83</a>  <em>   * @see org.apache.log4j.db.ConnectionSource#getConnection()</em>
+<a name="84" href="#84">84</a>  <em>   */</em>
+<a name="85" href="#85">85</a>    <strong>public</strong> Connection getConnection()
+<a name="86" href="#86">86</a>           throws SQLException {
+<a name="87" href="#87">87</a>      Connection conn = <strong>null</strong>;
+<a name="88" href="#88">88</a>      <strong>try</strong> {
+<a name="89" href="#89">89</a>  
+<a name="90" href="#90">90</a>        <strong>if</strong>(dataSource == <strong>null</strong>) {
+<a name="91" href="#91">91</a>          dataSource = lookupDataSource();
+<a name="92" href="#92">92</a>        }
+<a name="93" href="#93">93</a>        <strong>if</strong> (getUser() == <strong>null</strong>) {
+<a name="94" href="#94">94</a>          conn = dataSource.getConnection();
+<a name="95" href="#95">95</a>        } <strong>else</strong> {
+<a name="96" href="#96">96</a>          conn = dataSource.getConnection(getUser(), getPassword());
+<a name="97" href="#97">97</a>        }
+<a name="98" href="#98">98</a>      } <strong>catch</strong> (<strong>final</strong> NamingException ne) {
+<a name="99" href="#99">99</a>           getLogger().error(<span class="string">"Error while getting data source"</span>, ne);
+<a name="100" href="#100">100</a>       <strong>throw</strong> <strong>new</strong> SQLException(<span class="string">"NamingException while looking up DataSource: "</span> + ne.getMessage());
+<a name="101" href="#101">101</a>     } <strong>catch</strong> (<strong>final</strong> ClassCastException cce) {
+<a name="102" href="#102">102</a>       getLogger().error(<span class="string">"ClassCastException while looking up DataSource."</span>, cce);
+<a name="103" href="#103">103</a>       <strong>throw</strong> <strong>new</strong> SQLException(<span class="string">"ClassCastException while looking up DataSource: "</span> + cce.getMessage());
+<a name="104" href="#104">104</a>     }
+<a name="105" href="#105">105</a> 
+<a name="106" href="#106">106</a>     <strong>return</strong> conn;
+<a name="107" href="#107">107</a>   }
+<a name="108" href="#108">108</a> 
+<a name="109" href="#109">109</a>   <em>/**<em>*</em></em>
+<a name="110" href="#110">110</a> <em>   * Returns the jndiLocation.</em>
+<a name="111" href="#111">111</a> <em>   * @return String</em>
+<a name="112" href="#112">112</a> <em>   */</em>
+<a name="113" href="#113">113</a>   <strong>public</strong> String getJndiLocation() {
+<a name="114" href="#114">114</a>     <strong>return</strong> jndiLocation;
+<a name="115" href="#115">115</a>   }
+<a name="116" href="#116">116</a> 
+<a name="117" href="#117">117</a> 
+<a name="118" href="#118">118</a>   <em>/**<em>*</em></em>
+<a name="119" href="#119">119</a> <em>   * Sets the jndiLocation.</em>
+<a name="120" href="#120">120</a> <em>   * @param jndiLocation The jndiLocation to set</em>
+<a name="121" href="#121">121</a> <em>   */</em>
+<a name="122" href="#122">122</a>   <strong>public</strong> <strong>void</strong> setJndiLocation(String jndiLocation) {
+<a name="123" href="#123">123</a>     <strong>this</strong>.jndiLocation = jndiLocation;
+<a name="124" href="#124">124</a>   }
+<a name="125" href="#125">125</a> 
+<a name="126" href="#126">126</a> 
+<a name="127" href="#127">127</a>   <strong>private</strong> DataSource lookupDataSource()
+<a name="128" href="#128">128</a>          throws NamingException, SQLException {
+<a name="129" href="#129">129</a>     DataSource ds;
+<a name="130" href="#130">130</a>     Context ctx = <strong>new</strong> InitialContext();
+<a name="131" href="#131">131</a>     Object obj = ctx.lookup(jndiLocation);
+<a name="132" href="#132">132</a> 
+<a name="133" href="#133">133</a>     <em class="comment">// PortableRemoteObject was introduced in JDK 1.3. We won't use it.</em>
+<a name="134" href="#134">134</a>     <em class="comment">//ds = (DataSource)PortableRemoteObject.narrow(obj, DataSource.class);</em>
+<a name="135" href="#135">135</a>     ds = (DataSource) obj;
+<a name="136" href="#136">136</a> 
+<a name="137" href="#137">137</a>     <strong>if</strong> (ds == <strong>null</strong>) {
+<a name="138" href="#138">138</a>       <strong>throw</strong> <strong>new</strong> SQLException(<span class="string">"Failed to obtain data source from JNDI location "</span> + jndiLocation);
+<a name="139" href="#139">139</a>     } <strong>else</strong> {
+<a name="140" href="#140">140</a>       <strong>return</strong> ds;
+<a name="141" href="#141">141</a>     }
+<a name="142" href="#142">142</a>   }
+<a name="143" href="#143">143</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/JNDIConnectionSource.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/HSQLDBDialect.html
URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/HSQLDBDialect.html?view=auto&rev=558362
==============================================================================
--- logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/HSQLDBDialect.html (added)
+++ logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/HSQLDBDialect.html Sat Jul 21 10:50:33 2007
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>HSQLDBDialect xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../../../../../../apidocs/org/apache/log4j/db/dialect/HSQLDBDialect.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em class="comment">/*</em>
+<a name="2" href="#2">2</a>   <em class="comment"> * Copyright 1999,2004 The Apache Software Foundation.</em>
+<a name="3" href="#3">3</a>   <em class="comment"> *</em>
+<a name="4" href="#4">4</a>   <em class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</em>
+<a name="5" href="#5">5</a>   <em class="comment"> * you may not use this file except in compliance with the License.</em>
+<a name="6" href="#6">6</a>   <em class="comment"> * You may obtain a copy of the License at</em>
+<a name="7" href="#7">7</a>   <em class="comment"> *</em>
+<a name="8" href="#8">8</a>   <em class="comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="9" href="#9">9</a>   <em class="comment"> *</em>
+<a name="10" href="#10">10</a>  <em class="comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="11" href="#11">11</a>  <em class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a name="12" href="#12">12</a>  <em class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a name="13" href="#13">13</a>  <em class="comment"> * See the License for the specific language governing permissions and</em>
+<a name="14" href="#14">14</a>  <em class="comment"> * limitations under the License.</em>
+<a name="15" href="#15">15</a>  <em class="comment"> */</em>
+<a name="16" href="#16">16</a>  
+<a name="17" href="#17">17</a>  <strong>package</strong> org.apache.log4j.db.dialect; 
+<a name="18" href="#18">18</a>  
+<a name="19" href="#19">19</a>  <em>/**<em>* </em></em>
+<a name="20" href="#20">20</a>  <em> * The HSQLDB dialect. </em>
+<a name="21" href="#21">21</a>  <em> * </em>
+<a name="22" href="#22">22</a>  <em> * @author &lt;a href="<a href="http://www.qos.ch/log4j/" target="alexandria_uri">http://www.qos.ch/log4j/</a>">Ceki G&amp;uuml;lc&amp;uuml;&lt;/a></em>
+<a name="23" href="#23">23</a>  <em>*/</em> 
+<a name="24" href="#24">24</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../../org/apache/log4j/db/dialect/HSQLDBDialect.html">HSQLDBDialect</a> implements <a href="../../../../../org/apache/log4j/db/dialect/SQLDialect.html">SQLDialect</a> { 
+<a name="25" href="#25">25</a>   <strong>public</strong> <strong>static</strong> <strong>final</strong> String SELECT_CURRVAL = <span class="string">"CALL IDENTITY()"</span>; 
+<a name="26" href="#26">26</a>  
+<a name="27" href="#27">27</a>   <strong>public</strong> String getSelectInsertId() { 
+<a name="28" href="#28">28</a>     <strong>return</strong> SELECT_CURRVAL; 
+<a name="29" href="#29">29</a>   } 
+<a name="30" href="#30">30</a>  }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/HSQLDBDialect.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/MsSQLDialect.html
URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/MsSQLDialect.html?view=auto&rev=558362
==============================================================================
--- logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/MsSQLDialect.html (added)
+++ logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/MsSQLDialect.html Sat Jul 21 10:50:33 2007
@@ -0,0 +1,46 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>MsSQLDialect xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../../../../../../apidocs/org/apache/log4j/db/dialect/MsSQLDialect.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em class="comment">/*</em>
+<a name="2" href="#2">2</a>   <em class="comment"> * Copyright 1999,2004 The Apache Software Foundation.</em>
+<a name="3" href="#3">3</a>   <em class="comment"> *</em>
+<a name="4" href="#4">4</a>   <em class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</em>
+<a name="5" href="#5">5</a>   <em class="comment"> * you may not use this file except in compliance with the License.</em>
+<a name="6" href="#6">6</a>   <em class="comment"> * You may obtain a copy of the License at</em>
+<a name="7" href="#7">7</a>   <em class="comment"> *</em>
+<a name="8" href="#8">8</a>   <em class="comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="9" href="#9">9</a>   <em class="comment"> *</em>
+<a name="10" href="#10">10</a>  <em class="comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="11" href="#11">11</a>  <em class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a name="12" href="#12">12</a>  <em class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a name="13" href="#13">13</a>  <em class="comment"> * See the License for the specific language governing permissions and</em>
+<a name="14" href="#14">14</a>  <em class="comment"> * limitations under the License.</em>
+<a name="15" href="#15">15</a>  <em class="comment"> */</em>
+<a name="16" href="#16">16</a>  
+<a name="17" href="#17">17</a>  <strong>package</strong> org.apache.log4j.db.dialect; 
+<a name="18" href="#18">18</a>  
+<a name="19" href="#19">19</a>  <em>/**<em>* </em></em>
+<a name="20" href="#20">20</a>  <em>* The MS SQL Server dialect is untested. </em>
+<a name="21" href="#21">21</a>  <em>* </em>
+<a name="22" href="#22">22</a>  <em>* Note that the dialect is not needed if your JDBC driver supports </em>
+<a name="23" href="#23">23</a>  <em>* the getGeneratedKeys method introduced in JDBC 3.0 specification.</em>
+<a name="24" href="#24">24</a>  <em>* </em>
+<a name="25" href="#25">25</a>  <em>* @author James Stauffer </em>
+<a name="26" href="#26">26</a>  <em>*/</em> 
+<a name="27" href="#27">27</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../../org/apache/log4j/db/dialect/MsSQLDialect.html">MsSQLDialect</a> implements <a href="../../../../../org/apache/log4j/db/dialect/SQLDialect.html">SQLDialect</a> { 
+<a name="28" href="#28">28</a>   <strong>public</strong> <strong>static</strong> <strong>final</strong> String SELECT_CURRVAL = <span class="string">"SELECT @@identity id"</span>; 
+<a name="29" href="#29">29</a>  
+<a name="30" href="#30">30</a>   <strong>public</strong> String getSelectInsertId() { 
+<a name="31" href="#31">31</a>     <strong>return</strong> SELECT_CURRVAL; 
+<a name="32" href="#32">32</a>   } 
+<a name="33" href="#33">33</a>  }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/MsSQLDialect.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/MySQLDialect.html
URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/MySQLDialect.html?view=auto&rev=558362
==============================================================================
--- logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/MySQLDialect.html (added)
+++ logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/MySQLDialect.html Sat Jul 21 10:50:33 2007
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>MySQLDialect xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../../../../../../apidocs/org/apache/log4j/db/dialect/MySQLDialect.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em class="comment">/*</em>
+<a name="2" href="#2">2</a>   <em class="comment"> * Copyright 1999,2004 The Apache Software Foundation.</em>
+<a name="3" href="#3">3</a>   <em class="comment"> *</em>
+<a name="4" href="#4">4</a>   <em class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</em>
+<a name="5" href="#5">5</a>   <em class="comment"> * you may not use this file except in compliance with the License.</em>
+<a name="6" href="#6">6</a>   <em class="comment"> * You may obtain a copy of the License at</em>
+<a name="7" href="#7">7</a>   <em class="comment"> *</em>
+<a name="8" href="#8">8</a>   <em class="comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="9" href="#9">9</a>   <em class="comment"> *</em>
+<a name="10" href="#10">10</a>  <em class="comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="11" href="#11">11</a>  <em class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a name="12" href="#12">12</a>  <em class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a name="13" href="#13">13</a>  <em class="comment"> * See the License for the specific language governing permissions and</em>
+<a name="14" href="#14">14</a>  <em class="comment"> * limitations under the License.</em>
+<a name="15" href="#15">15</a>  <em class="comment"> */</em>
+<a name="16" href="#16">16</a>  
+<a name="17" href="#17">17</a>  <strong>package</strong> org.apache.log4j.db.dialect;
+<a name="18" href="#18">18</a>  
+<a name="19" href="#19">19</a>  <em>/**<em>*</em></em>
+<a name="20" href="#20">20</a>  <em> * </em>
+<a name="21" href="#21">21</a>  <em> * </em>
+<a name="22" href="#22">22</a>  <em> * @author Ceki</em>
+<a name="23" href="#23">23</a>  <em> *</em>
+<a name="24" href="#24">24</a>  <em> */</em>
+<a name="25" href="#25">25</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../../org/apache/log4j/db/dialect/MySQLDialect.html">MySQLDialect</a> implements <a href="../../../../../org/apache/log4j/db/dialect/SQLDialect.html">SQLDialect</a> {
+<a name="26" href="#26">26</a>    <strong>public</strong> <strong>static</strong> <strong>final</strong> String SELECT_LAST_INSERT_ID = <span class="string">"SELECT LAST_INSERT_ID()"</span>;
+<a name="27" href="#27">27</a>    
+<a name="28" href="#28">28</a>    <strong>public</strong> String getSelectInsertId() {
+<a name="29" href="#29">29</a>      <strong>return</strong> SELECT_LAST_INSERT_ID;
+<a name="30" href="#30">30</a>    }
+<a name="31" href="#31">31</a>  }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/MySQLDialect.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/OracleDialect.html
URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/OracleDialect.html?view=auto&rev=558362
==============================================================================
--- logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/OracleDialect.html (added)
+++ logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/OracleDialect.html Sat Jul 21 10:50:33 2007
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>OracleDialect xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../../../../../../apidocs/org/apache/log4j/db/dialect/OracleDialect.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em class="comment">/*</em>
+<a name="2" href="#2">2</a>   <em class="comment"> * Copyright 1999,2004 The Apache Software Foundation.</em>
+<a name="3" href="#3">3</a>   <em class="comment"> *</em>
+<a name="4" href="#4">4</a>   <em class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</em>
+<a name="5" href="#5">5</a>   <em class="comment"> * you may not use this file except in compliance with the License.</em>
+<a name="6" href="#6">6</a>   <em class="comment"> * You may obtain a copy of the License at</em>
+<a name="7" href="#7">7</a>   <em class="comment"> *</em>
+<a name="8" href="#8">8</a>   <em class="comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="9" href="#9">9</a>   <em class="comment"> *</em>
+<a name="10" href="#10">10</a>  <em class="comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="11" href="#11">11</a>  <em class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a name="12" href="#12">12</a>  <em class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a name="13" href="#13">13</a>  <em class="comment"> * See the License for the specific language governing permissions and</em>
+<a name="14" href="#14">14</a>  <em class="comment"> * limitations under the License.</em>
+<a name="15" href="#15">15</a>  <em class="comment"> */</em>
+<a name="16" href="#16">16</a>  
+<a name="17" href="#17">17</a>  <strong>package</strong> org.apache.log4j.db.dialect;
+<a name="18" href="#18">18</a>  
+<a name="19" href="#19">19</a>  <em>/**<em>*</em></em>
+<a name="20" href="#20">20</a>  <em> * The Oracle dialect. Tested successfully on Oracle9i Release 9.2.0.3.0 by </em>
+<a name="21" href="#21">21</a>  <em> * James Stauffer.</em>
+<a name="22" href="#22">22</a>  <em> * </em>
+<a name="23" href="#23">23</a>  <em> * @author Ceki G&amp;uuml;lc&amp;uuml;</em>
+<a name="24" href="#24">24</a>  <em> */</em>
+<a name="25" href="#25">25</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../../org/apache/log4j/db/dialect/OracleDialect.html">OracleDialect</a> implements <a href="../../../../../org/apache/log4j/db/dialect/SQLDialect.html">SQLDialect</a> {
+<a name="26" href="#26">26</a>    <strong>public</strong> <strong>static</strong> <strong>final</strong> String SELECT_CURRVAL = <span class="string">"SELECT logging_event_id_seq.currval from dual"</span>;
+<a name="27" href="#27">27</a>  
+<a name="28" href="#28">28</a>    <strong>public</strong> String getSelectInsertId() {
+<a name="29" href="#29">29</a>      <strong>return</strong> SELECT_CURRVAL;
+<a name="30" href="#30">30</a>    }
+<a name="31" href="#31">31</a>  
+<a name="32" href="#32">32</a>  }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: logging/site/trunk/docs/log4j/companions/receivers/xref/org/apache/log4j/db/dialect/OracleDialect.html
------------------------------------------------------------------------------
    svn:mime-type = text/html



Mime
View raw message