Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <GlobalNamingResources>
- <Resource auth="Container"
- name="jdbc/test1"
- driverClassName="com.mysql.jdbc.Driver"
- type="javax.sql.DataSource"
- url="xxxxxx"
- username="xxxxx"
- password="xxxxx"
- validationQuery="SELECT 1"
- initialSize="40"
- maxActive="-2"
- maxIdle="40"
- maxWait="10000"
- minEvictableIdleTimeMillis="25"
- removeAbandoned="true"
- removeAbandonedTimeout="120"
- testOnBorrow="true"
- testWhileIdle="true"
- timeBetweenEvictionRunsMillis="1800000"
- maxHttpHeaderSize="8192"
- maxThreads="150"
- minSpareThreads="25"
- maxSpareThreads="75"
- enableLookups="false"
- acceptCount="100"
- disableUploadTimeout="true"
- useBodyEncodingForURI="true"
- compression="on"
- compressionMinSize="1024"
- noCompressionUserAgents="gozilla, traviata"
- factory="xxxxxxxx" />
- <Resource auth="Container"
- name="jdbc/test2"
- driverClassName="com.mysql.jdbc.Driver"
- type="javax.sql.DataSource"
- url="yyyyyy"
- username="yyyyyy"
- password="yyyyyyyyy"
- validationQuery="SELECT 1"
- initialSize="40"
- maxActive="-2"
- maxIdle="40"
- maxWait="10000"
- minEvictableIdleTimeMillis="25"
- removeAbandoned="true"
- removeAbandonedTimeout="120"
- testOnBorrow="true"
- testWhileIdle="true"
- timeBetweenEvictionRunsMillis="1800000"
- maxHttpHeaderSize="8192"
- maxThreads="150"
- minSpareThreads="25"
- maxSpareThreads="75"
- enableLookups="false"
- acceptCount="100"
- disableUploadTimeout="true"
- useBodyEncodingForURI="true"
- compression="on"
- compressionMinSize="1024"
- noCompressionUserAgents="gozilla, traviata"
- factory="xxxxxxxx" />
- </GlobalNamingResources>
- Context initContext = new InitialContext();
- Context envContext = (Context) initContext.lookup("java:/comp/env");
- DataSource dataSource = (DataSource) envContext.lookup("jdbc/test2");
- javax.naming.NameNotFoundException: Name [test2] is not bound in this Context. Unable to find [test2].
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement