When you configure the Tomcat data source (DB2) in Linux, the data source configuration is as follows:
Conf \ Server. xml:
<Globalnamingresources>
<! -- Test entry for demonstration purposes -->
<Environment name = "simplevalue" type = "Java. Lang. Integer" value = "30"/>
<! -- Editable user database that can also be used
Userdatabaserealm to authenticate users -->
<Resource Name = "userdatabase" auth = "Container"
Type = "org. Apache. Catalina. userdatabase"
Description = "user database that can be updated and saved"
Factory = "org. Apache. Catalina. Users. memoryuserdatabasefactory"
Pathname = "CONF/tomcat-users.xml"/>
<Resource driverclassname = "com. IBM. db2.jcc. db2driver "maxactive =" 4 "maxidle =" 2 "maxwait =" 5000 "name =" defaultdatasource "Password =" 123456 "type =" javax. SQL. datasource "url =" JDBC: DB2: // 127.0.0.1: 50000/zxdb "username =" db2admin "/>
</Globalnamingresources>
Conf \ context. xml:
<Context>
<! -- Default set of monitored resources -->
<Watchedresource> WEB-INF/Web. xml </watchedresource>
<! -- Uncomment this to disable session persistence resume SS Tomcat restarts -->
<! --
<Manager pathname = ""/>
-->
<Resourcelink global = "defaultdatasource" name = "defaultdatasource" type = "javax. SQL. datasource"/>
</Context>
The error message is as follows:
Message: No data source named ''{0}'' is found. (The datasource
Name 'default' cannot get connection !)
At
Com. primeton. Common. Connection. impl. datasource. Ext. unconfirmedd
Atasource. getdatasource (unconfirmeddatasource. Java: 83)
At
Com. primeton. Common. Connection. impl. datasource. Ext. unconfirmedd
Atasource. getconnection (unconfirmeddatasource. Java: 124)
Resolve db2jcc. jar, db2jcc_license_cisuz.jar, db2jcc_license_cu.jar, and JTA. Jar (Java. Lang. noclassdeffounderror: javax/transaction/usertransaction)
4 jar packages, put them in the common \ lib directory of Tomcat, and then restart the service.