Created
June 8, 2020 06:56
-
-
Save nagetsum/bebfde8bff197c367badc03875debb4b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<Context> | |
<Resource name="jdbc/myappDS" | |
auth="Container" | |
type="javax.sql.DataSource" | |
initialSize="20" maxTotal="20" maxIdle="20" maxWaitMillis="10000" | |
username="postgres" password="postgres" driverClassName="org.postgresql.Driver" | |
url="jdbc:postgresql://localhost:5432/test" | |
connectionProperties="loginTimeout=10;socketTimeout=310" | |
validationQuery="SELECT 1" | |
validationQueryTimeout="30" /> | |
</Context> | |
lookup above datasource in application code: | |
InitialContext.doLookup("java:comp/env/jdbc/myappDS"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment