Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. <GlobalNamingResources>
  2. <Resource auth="Container"
  3. name="jdbc/test1"
  4. driverClassName="com.mysql.jdbc.Driver"
  5. type="javax.sql.DataSource"
  6. url="xxxxxx"
  7. username="xxxxx"
  8. password="xxxxx"
  9. validationQuery="SELECT 1"
  10. initialSize="40"
  11. maxActive="-2"
  12. maxIdle="40"
  13. maxWait="10000"
  14. minEvictableIdleTimeMillis="25"
  15. removeAbandoned="true"
  16. removeAbandonedTimeout="120"
  17. testOnBorrow="true"
  18. testWhileIdle="true"
  19. timeBetweenEvictionRunsMillis="1800000"
  20. maxHttpHeaderSize="8192"
  21. maxThreads="150"
  22. minSpareThreads="25"
  23. maxSpareThreads="75"
  24. enableLookups="false"
  25. acceptCount="100"
  26. disableUploadTimeout="true"
  27. useBodyEncodingForURI="true"
  28. compression="on"
  29. compressionMinSize="1024"
  30. noCompressionUserAgents="gozilla, traviata"
  31. factory="xxxxxxxx" />
  32.  
  33. <Resource auth="Container"
  34. name="jdbc/test2"
  35. driverClassName="com.mysql.jdbc.Driver"
  36. type="javax.sql.DataSource"
  37. url="yyyyyy"
  38. username="yyyyyy"
  39. password="yyyyyyyyy"
  40. validationQuery="SELECT 1"
  41. initialSize="40"
  42. maxActive="-2"
  43. maxIdle="40"
  44. maxWait="10000"
  45. minEvictableIdleTimeMillis="25"
  46. removeAbandoned="true"
  47. removeAbandonedTimeout="120"
  48. testOnBorrow="true"
  49. testWhileIdle="true"
  50. timeBetweenEvictionRunsMillis="1800000"
  51. maxHttpHeaderSize="8192"
  52. maxThreads="150"
  53. minSpareThreads="25"
  54. maxSpareThreads="75"
  55. enableLookups="false"
  56. acceptCount="100"
  57. disableUploadTimeout="true"
  58. useBodyEncodingForURI="true"
  59. compression="on"
  60. compressionMinSize="1024"
  61. noCompressionUserAgents="gozilla, traviata"
  62. factory="xxxxxxxx" />
  63. </GlobalNamingResources>
  64.  
  65. Context initContext = new InitialContext();
  66. Context envContext = (Context) initContext.lookup("java:/comp/env");
  67. DataSource dataSource = (DataSource) envContext.lookup("jdbc/test2");
  68.  
  69. 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