<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  
  <channel>
    <title>John Topley's Knowledge Base</title>
    <link>http://johntopley.textdriven.com/oldblog/</link>
    <description>John Topley's Knowledge Base.</description>
    <language>en-gb</language>
    <copyright>Copyright &#169; 2003 -  2005 John Topley</copyright>
    <lastBuildDate>
      Thu, 24 Mar 2005 11:07:39 GMT
      
    </lastBuildDate>
    <managingEditor>editor@johntopley.com</managingEditor>
    <webMaster>webmaster@johntopley.com</webMaster>

    
      <item>
        <title>Adding An Entry To The Bash Path</title>
        <link>http://www.johntopley.com/kb/macosx/0040.html</link>
        <comments> http://www.johntopley.com/comments/kb/comments.php?id=200503241036</comments>
        <guid isPermaLink="true">http://www.johntopley.com/kb/macosx/0040.html</guid>
        <pubDate>Thu, 24 Mar 2005 11:07:39 GMT</pubDate>
        <description>
          <![CDATA[<p>To add a path entry to the <acronym title="Bourne Again SHell">Bash</acronym> path, enter the command below in a Terminal window:</p>
<blockquote>
echo 'export PATH=$PATH:/Path/To/Add' &gt;&gt; ~/.bash_profile
</blockquote>]]>
        </description>
      </item>
    
      <item>
        <title>Order Of Elements In web.xml Deployment Descriptor</title>
        <link>http://www.johntopley.com/kb/java/0039.html</link>
        <comments> http://www.johntopley.com/comments/kb/comments.php?id=200503121441</comments>
        <guid isPermaLink="true">http://www.johntopley.com/kb/java/0039.html</guid>
        <pubDate>Sat, 12 Mar 2005 15:10:00 GMT</pubDate>
        <description>
          <![CDATA[<p>This reference details the order that elements should appear in the web.xml Web application deployment descriptor file.</p>
<blockquote>
&lt;web-app&gt;<br />
&nbsp;&nbsp;&lt;icon&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;small-icon&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;large-icon&gt;<br />
&nbsp;&nbsp;&lt;/icon&gt;<br />
<br />
&nbsp;&nbsp;&lt;display-name&gt;<br />
&nbsp;&nbsp;&lt;description&gt;<br />
&nbsp;&nbsp;&lt;distributable&gt;<br />
<br />
&nbsp;&nbsp;&lt;context-param&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;param-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;param-value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;<br />
&nbsp;&nbsp;&lt;/context-param&gt;<br />
<br />
&nbsp;&nbsp;&lt;filter&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;icon&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;small-icon&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;large-icon&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/icon&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;filter-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;display-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;filter-class&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;init-param&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;param-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;param-value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/init-param&gt;<br />
&nbsp;&nbsp;&lt;/filter&gt;<br />
<br />
&nbsp;&nbsp;&lt;filter-mapping&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;filter-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;url-pattern&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;servlet&gt;<br />
&nbsp;&nbsp;&lt;/filter-mapping&gt;<br />
<br />
&nbsp;&nbsp;&lt;listener&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;listener-class&gt;<br />
&nbsp;&nbsp;&lt;/listener&gt;<br />
<br />
&nbsp;&nbsp;&lt;servlet&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;icon&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;small-icon&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;large-icon&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/icon&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;servlet-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;display-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;servlet-class&gt; or &lt;jsp-file&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;init-param&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;param-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;param-value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/init-param&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;load-on-startup&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;security-role-ref&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;role-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;role-link&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/security-role-ref&gt;<br />
&nbsp;&nbsp;&lt;/servlet&gt;<br />
<br />
&nbsp;&nbsp;&lt;servlet-mapping&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;servlet-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;url-pattern&gt;<br />
&nbsp;&nbsp;&lt;/servlet-mapping&gt;<br />
<br />
&nbsp;&nbsp;&lt;session-config&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;session-timeout&gt;<br />
&nbsp;&nbsp;&lt;/session-config&gt;<br />
<br />
&nbsp;&nbsp;&lt;mime-mapping&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;extension&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;mime-type&gt;<br />
&nbsp;&nbsp;&lt;/mime-mapping&gt;<br />
<br />
&nbsp;&nbsp;&lt;welcome-file-list&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;welcome-file&gt;<br />
&nbsp;&nbsp;&lt;/welcome-file-list&gt;<br />
<br />
&nbsp;&nbsp;&lt;error-page&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;error-code&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;exception-type&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;location&gt;<br />
&nbsp;&nbsp;&lt;/error-page&gt;<br />
<br />
&nbsp;&nbsp;&lt;taglib&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;taglib-location&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;taglib-uri&gt;<br />
&nbsp;&nbsp;&lt;/taglib&gt;<br />
<br />
&nbsp;&nbsp;&lt;resource-ref&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;res-ref-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;res-ref-type&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;res-ref-auth&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;res-sharing-scope&gt;<br />
&nbsp;&nbsp;&lt;/resource-ref&gt;<br />
<br />
&nbsp;&nbsp;&lt;security-constraint&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;web-resource-collection&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;web-resource-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;url-pattern&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;http-method&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/web-resource-collection&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;auth-contraint&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;role-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/auth-constraint&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;user-data-contraint&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;transport-guarantee&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;user-data-contraint&gt;<br />
&nbsp;&nbsp;&lt;/security-constraint&gt;<br />
<br />
&nbsp;&nbsp;&lt;login-config&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;auth-method&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;realm-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;form-login-config&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;form-login-page&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;form-error-page&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/form-login-config&gt;<br />
&nbsp;&nbsp;&lt;/login-config&gt;<br />
<br />
&nbsp;&nbsp;&lt;security-role&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;role-name&gt;<br />
&nbsp;&nbsp;&lt;/security-role&gt;<br />
<br />
&nbsp;&nbsp;&lt;env-entry&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;env-entry-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;env-entry-value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;env-entry-type&gt;<br />
&nbsp;&nbsp;&lt;/env-entry&gt;<br />
<br />
&nbsp;&nbsp;&lt;ejb-ref&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;ejb-ref-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;ejb-ref-type&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;home&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;remote&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;ejb-link&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;run-as&gt;<br />
&nbsp;&nbsp;&lt;/ejb-ref&gt;<br />
&lt;/web-app&gt;
</blockquote>]]>
        </description>
      </item>
    
      <item>
        <title>Using A MySQL Data Source With Jakarta Tomcat</title>
        <link>http://www.johntopley.com/kb/java/0038.html</link>
        <comments> http://www.johntopley.com/comments/kb/comments.php?id=200411211155</comments>
        <guid isPermaLink="true">http://www.johntopley.com/kb/java/0038.html</guid>
        <pubDate>Sun, 21 Nov 2004 17:04:17 GMT</pubDate>
        <description>
          <![CDATA[<p>These instructions describe how to configure the Jakarta Tomcat web container to use a MySQL data source. They've been tested using Tomcat 5.0.28 and MySQL 4.0.18, but should work with Tomcat 4 and other versions of MySQL too. Note that CATALINA_HOME refers to the root of the Tomcat installation folder.</p>
<ul><li>The configuration is a three step process:</li></ul>
<ol>
<li>Copy the MySQL <acronym title="Java Database Connectivity">JDBC</acronym> driver <acronym title="Java ARchive">JAR</acronym> file to CATALINA_HOME/common/lib.</li>
<li>Edit the CATALINA_HOME/conf/server.xml file so that it includes a context definition for the web application that will use the data source. The first code block below shows the main elements of server.xml and the second shows the detail of the context definition for a fictious web application called MyWebApp:
<blockquote>
&lt;Server&gt;<br />
&nbsp;&nbsp;&lt;Service&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;Engine&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Host&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Context&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!-- Existing context definitions. --&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Context&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| Paste in context definition shown below right here.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+--&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Host&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Engine&gt;<br />
&nbsp;&nbsp;&lt;/Service&gt;<br />
&lt;/Server&gt;
</blockquote>
<blockquote>
&lt;!--<br />
&nbsp;&nbsp; | Begin MyWebApp context definition.<br />
&nbsp;&nbsp; +--&gt;<br />
&lt;Context path=&quot;/MyWebApp&quot; docBase=&quot;MyWebApp&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp;reloadable=&quot;true&quot;&gt;<br />
<br />
&nbsp;&nbsp;&lt;Logger className=&quot;org.apache.catalina.logger.FileLogger&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prefix=&quot;localhost_MyWebApp.&quot; suffix=&quot;.txt&quot; timestamp=&quot;true&quot;/&gt;<br />
<br />
&nbsp;&nbsp;&lt;Resource name=&quot;jdbc/MyWebAppDS&quot; auth=&quot;Container&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type=&quot;javax.sql.DataSource&quot;/&gt;<br />
<br />
&nbsp;&nbsp;&lt;ResourceParams name=&quot;jdbc/MyWebAppDS&quot;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;parameter&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;factory&lt;/name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;org.apache.commons.dbcp.BasicDataSourceFactory&lt;/value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/parameter&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| The JDBC connection URL for connecting to your MySQL DB.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| The autoReconnect=true argument to the URL makes sure that the<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| MySQL JDBC Driver will automatically reconnect if mysqld closed<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| the connection. mysqld by default closes idle connections after<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| 8 hours.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+--&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;parameter&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;url&lt;/name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;jdbc:mysql://localhost:3306/mywebapp_db_name?<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;autoReconnect=true&lt;/value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/parameter&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| MySQL username and password for DB connections.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+--&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;parameter&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;username&lt;/name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;<em>username</em>&lt;/value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/parameter&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;parameter&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;password&lt;/name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;<em>password</em>&lt;/value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/parameter&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| Class name for MySQL JDBC driver.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+--&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;parameter&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;driverClassName&lt;/name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;com.mysql.jdbc.Driver&lt;/value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/parameter&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| Maximum number of DB connections in pool. Make sure you<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| configure your mysqld max_connections large enough to handle<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| all of your DB connections. Set to 0 for no limit.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+--&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;parameter&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;maxActive&lt;/name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;100&lt;/value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/parameter&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| Maximum number of idle DB connections to retain in pool.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| Set to 0 for no limit.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+--&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;parameter&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;maxIdle&lt;/name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;30&lt;/value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/parameter&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| Maximum time to wait for a DB connection to become available<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| in ms, in this example 10 seconds. An exception is thrown if<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| this timeout is exceeded.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| Set to -1 to wait indefinitely.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+--&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;parameter&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;maxWait&lt;/name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;10000&lt;/value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/parameter&gt;<br />
&nbsp;&nbsp;&lt;/ResourceParams&gt;<br />
&lt;/Context&gt;<br />
&lt;!--<br />
&nbsp;&nbsp;| End MyWebApp context definition.<br />
&nbsp;&nbsp;+--&gt;
</blockquote></li>
<li>Edit the web application's web.xml file to add a resource reference definition for the <acronym title="Java Naming and Directory Interface">JNDI</acronym> data source:
<blockquote>
&lt;resource-ref&gt;<br />
&nbsp;&nbsp;&lt;description&gt;MyWebApp data source.&lt;/description&gt;<br />
&nbsp;&nbsp;&lt;res-ref-name&gt;jdbc/MyWebAppDS&lt;/res-ref-name&gt;<br />
&nbsp;&nbsp;&lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;<br />
&nbsp;&nbsp;&lt;res-auth&gt;Container&lt;/res-auth&gt;<br />
&lt;/resource-ref&gt;
</blockquote></li>
</ol>
<ul><li><a href="http://www.akadia.com/download/soug/tomcat/html/tomcat_server_xml.html">Demystifying tomcat 4's server.xml file</a>.</li></ul>]]>
        </description>
      </item>
    
      <item>
        <title>SQL Statement To List Schemas</title>
        <link>http://www.johntopley.com/kb/oracle/0037.html</link>
        <comments> http://www.johntopley.com/comments/kb/comments.php?id=200410161245</comments>
        <guid isPermaLink="true">http://www.johntopley.com/kb/oracle/0037.html</guid>
        <pubDate>Sun, 21 Nov 2004 12:07:30 GMT</pubDate>
        <description>
          <![CDATA[<p>This Oracle <acronym title="Structured Query Language">SQL</acronym> statement will display a list of schemas within the database.</p>
<blockquote>
SELECT username FROM all_users ORDER BY username;
</blockquote>
<p>To get Oracle SQL*Plus to display a page at a time, use:</p>
<blockquote>
set pause on
</blockquote>
<p>&#8212;And press Enter to page.</p>]]>
        </description>
      </item>
    
      <item>
        <title>SQL Statement To List Tables Within Current Schema</title>
        <link>http://www.johntopley.com/kb/oracle/0036.html</link>
        <comments> http://www.johntopley.com/comments/kb/comments.php?id=200409102231</comments>
        <guid isPermaLink="true">http://www.johntopley.com/kb/oracle/0036.html</guid>
        <pubDate>Fri, 10 Sep 2004 23:05:16 GMT</pubDate>
        <description>
          <![CDATA[<p>This Oracle <acronym title="Structured Query Language">SQL</acronym> statement will display the names of all the tables within the current user's schema.</p>
<blockquote>
SELECT table_name FROM user_tables;
</blockquote>
<p>To display the names of all the tables that the current user has access to, use:</p>
<blockquote>
SELECT table_name FROM all_tables;
</blockquote>]]>
        </description>
      </item>
    
      <item>
        <title>SQL Statement To Change A User's Password</title>
        <link>http://www.johntopley.com/kb/oracle/0035.html</link>
        <comments> http://www.johntopley.com/comments/kb/comments.php?id=200408102015</comments>
        <guid isPermaLink="true">http://www.johntopley.com/kb/oracle/0035.html</guid>
        <pubDate>Tue, 10 Aug 2004 20:18:08 GMT</pubDate>
        <description>
          <![CDATA[<p>This Oracle <acronym title="Structured Query Language">SQL</acronym> statement will change the password for the user named <em>user</em> to the password <em>password</em>.</p>
<blockquote>
ALTER USER <em>user</em> IDENTIFIED BY <em>password</em>
</blockquote>]]>
        </description>
      </item>
    
      <item>
        <title>Retaining The Time Component When Writing To A Date Column</title>
        <link>http://www.johntopley.com/kb/java/0034.html</link>
        <comments> http://www.johntopley.com/comments/kb/comments.php?id=200405151524</comments>
        <guid isPermaLink="true">http://www.johntopley.com/kb/java/0034.html</guid>
        <pubDate>Sat, 15 May 2004 15:37:01 GMT</pubDate>
        <description>
          <![CDATA[<p>Writing to a date type column in a database using the <acronym title="Java DataBase Connectivity">JDBC</acronym> PreparedStatement's setDate method, results in the time component being lost i.e. it gets set to 00:00:00.</p>
<p>The code given below shows how to retain the time component. In this example, &#8220;pstmt&#8221; is a variable of type java.sql.PreparedStatement and the current date and time are used. Note that java.util.Date's getTime method can be used when specific dates need to be passed to the setTimestamp method.</p>
<blockquote>
pstmt.setTimestamp(1, new Timestamp(System.currentTimeMillis()));
</blockquote>]]>
        </description>
      </item>
    
      <item>
        <title>Retaining The Time Component When Assigning A SQL Date To A Java Date</title>
        <link>http://www.johntopley.com/kb/java/0033.html</link>
        <comments> http://www.johntopley.com/comments/kb/comments.php?id=200405052131</comments>
        <guid isPermaLink="true">http://www.johntopley.com/kb/java/0033.html</guid>
        <pubDate>Wed, 05 May 2004 21:59:59 GMT</pubDate>
        <description>
          <![CDATA[<p>When retrieving a java.sql.Date object&#8212;representing the contents of a database date column&#8212;using the <acronym title="Java DataBase Connectivity">JDBC</acronym> ResultSet's getDate method, assigning the retrieved value to a java.util.Date object causes the time component to be lost i.e. it gets set to 00:00:00.</p>
<p>The code given below shows how to retain the time component. &#8220;rset&#8221; is a variable of type java.sql.ResultSet.</p>
<blockquote>
java.util.Date dateUpdated<br />
&nbsp;&nbsp;= new Date(rset.getTimestamp(&quot;DateUpdated&quot;).getTime());
</blockquote>]]>
        </description>
      </item>
    
      <item>
        <title>Using Struts To Display Exception Details On A JSP</title>
        <link>http://www.johntopley.com/kb/java/0032.html</link>
        <comments> http://www.johntopley.com/comments/kb/comments.php?id=200312221547</comments>
        <guid isPermaLink="true">http://www.johntopley.com/kb/java/0032.html</guid>
        <pubDate>Mon, 22 Dec 2003 16:15:11 GMT</pubDate>
        <description>
          <![CDATA[<p>Jakarta Struts can be configured to use declarative exception handling with a global or ActionMapping scope. The class of exception to be caught and a <acronym title="JavaServer Page">JSP</acronym> to display when the exception occurs may also be specified.</p>
<p>The code given below displays the exception message and the stack trace. A page-scope JavaBean named &#8220;exception&#8221; is defined that contains the Exception object that Struts has placed under the <acronym title="HyperText Transfer Protocol">HTTP</acronym> request key &#8220;org.apache.struts.action.EXCEPTION&#8221;. The bean is given the type &#8220;java.lang.Throwable&#8221; so that any runtime exceptions are caught and displayed too.</p>
<p>The Struts &lt;bean:write&gt; tag is then used to write the contents of that bean to the JSP. This displays the exception message. A scriptlet can be used to call the printStackTrace method, passing it a PrintWriter object that itself is passed the implicit &#8220;out&#8221; variable, so that the stack trace can be written to the page.</p>
<p>Note that typically when using Struts the text strings would be looked up from a resources file using the &lt;bean:message&gt; tag (not shown here).</p>
<p>Download <a href="http://www.johntopley.com/kb/files/0032.txt">0032.txt</a></p>
<ul><li>The JSP:</li></ul>
<blockquote>
&lt;%@ taglib uri=&quot;http://jakarta.apache.org/struts/tags-bean&quot; prefix=&quot;bean&quot; %&gt;<br />
<br />
&lt;bean:define id=&quot;exception&quot; name=&quot;org.apache.struts.action.EXCEPTION&quot;<br />
&nbsp;&nbsp;type=&quot;java.lang.Throwable&quot; /&gt;<br />
<br />
&lt;p&gt;<br />
&nbsp;&nbsp;Exception message:<br />
&lt;/p&gt;<br />
&lt;p&gt;<br />
&nbsp;&nbsp;&lt;bean:write name=&quot;exception&quot; /&gt;<br />
&lt;/p&gt;<br />
&lt;p&gt;<br />
&nbsp;&nbsp;Stack trace:<br />
&lt;/p&gt;<br />
&lt;p&gt;<br />
&nbsp;&nbsp;&lt;%<br />
&nbsp;&nbsp;&nbsp;&nbsp;exception.printStackTrace(new java.io.PrintWriter(out));<br />
&nbsp;&nbsp;%&gt;<br />
&lt;/p&gt;
</blockquote>]]>
        </description>
      </item>
    
      <item>
        <title>Using The Struts Logic Tag To Detect Browser Version</title>
        <link>http://www.johntopley.com/kb/java/0031.html</link>
        <comments> http://www.johntopley.com/comments/kb/comments.php?id=200312012017</comments>
        <guid isPermaLink="true">http://www.johntopley.com/kb/java/0031.html</guid>
        <pubDate>Mon, 01 Dec 2003 22:00:48 GMT</pubDate>
        <description>
          <![CDATA[<p>The Jakarta Struts &lt;logic:match&gt; tag can be used to detect the version of the web browser being used to view the page. The tag performs a case-insensitive substring search using the value specified. This enables the User-Agent string in the <acronym title="HyperText Transfer Protocol">HTTP</acronym> header to be queried for the browser version.</p>
<p>The code given below displays &#8220;Microsoft Internet Explorer 6.0&#8221; if running <acronym title="Internet Explorer">IE</acronym> 6.0, or &#8220;Opera&#8221; or &#8220;Mozilla&#8221; if running any version of those browsers.</p>
<p>Download <a href="http://www.johntopley.com/kb/files/0031.txt">0031.txt</a></p>
<ul><li>The JSP:</li></ul>
<blockquote>
&lt;logic:match header=&quot;User-Agent&quot; value=&quot;IE&quot;&gt;<br />
&nbsp;&nbsp;&lt;logic:match header=&quot;User-Agent&quot; value=&quot;6.0&quot;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Microsoft Internet Explorer 6.0&lt;/p&gt;<br />
&nbsp;&nbsp;&lt;/logic:match&gt;<br />
&lt;/logic:match&gt;<br />
&lt;logic:match header=&quot;User-Agent&quot; value=&quot;Opera&quot;&gt;<br />
&nbsp;&nbsp;&lt;p&gt;Opera&lt;/p&gt;<br />
&lt;/logic:match&gt;<br />
&lt;logic:match header=&quot;User-Agent&quot; value=&quot;Mozilla&quot;&gt;<br />
&nbsp;&nbsp;&lt;p&gt;Mozilla&lt;/p&gt;<br />
&lt;/logic:match&gt;
</blockquote>]]>
        </description>
      </item>
    
  </channel>
</rss>