Skip to content

Instantly share code, notes, and snippets.

@EugenyB
Created August 12, 2022 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EugenyB/480f4742f95773c32a621f588b886c41 to your computer and use it in GitHub Desktop.
Save EugenyB/480f4742f95773c32a621f588b886c41 to your computer and use it in GitHub Desktop.
context.xml example
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context>
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<Resource name="jdbc/chinook" auth="Container"
type="javax.sql.DataSource" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
testWhileIdle="true" testOnBorrow="true" testOnReturn="false"
validationQuery="SELECT 1" validationInterval="30000"
timeBetweenEvictionRunsMillis="30000" maxActive="100" minIdle="10"
maxWait="10000" initialSize="10" removeAbandonedTimeout="60"
removeAbandoned="true" logAbandoned="true" minEvictableIdleTimeMillis="30000"
jmxEnabled="true"
jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;
org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"
username="student" password="123" driverClassName="org.mariadb.jdbc.Driver"
url="jdbc:mariadb://localhost:3306/chinook" />
<!--
<Resource name="jdbc/expressions" auth="Container"
type="javax.sql.DataSource" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
testWhileIdle="true" testOnBorrow="true" testOnReturn="false"
validationQuery="SELECT 1" validationInterval="30000"
timeBetweenEvictionRunsMillis="30000" maxActive="100" minIdle="10"
maxWait="10000" initialSize="10" removeAbandonedTimeout="60"
removeAbandoned="true" logAbandoned="true" minEvictableIdleTimeMillis="30000"
jmxEnabled="true"
jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;
org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"
username="student" password="123" driverClassName="org.mariadb.jdbc.Driver"
url="jdbc:mariadb://localhost:3306/expressions" />
-->
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
</Context>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment