-->

2013-08-28

memo: DBCP

http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html

http://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html#Database_Connection_Pool_%28DBCP%29_Configurations

http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Database_Connection_Pool_%28DBCP%29_Configurations

http://www.atmarkit.co.jp/ait/articles/1111/07/news212.html

警告: Failed to register in JMX: javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory]

$ tar xvzf /usr/portage/distfiles/commons-dbcp-1.4-src.tar.gz
$ cd commons-dbcp-1.4-src/
$ grep -nri BasicDataSourceFactory .
...
$ grep -nriP "org\..*\.BasicDataSourceFactory" .
./xdocs/release-notes-1.2.1.xml:42:     at org.apache.commons.dbcp.BasicDataSourceFactory.createDataSource(BasicDataSourceFactory.java:162)
./xdocs/release-notes-1.2.1.xml:43:     at org.apache.commons.dbcp.BasicDataSourceFactory.getObjectInstance(BasicDataSourceFactory.java:144)
./xdocs/guide/jndi-howto.xml:57:    "org.apache.commons.dbcp.BasicDataSourceFactory", null);

$ grep -A24 "jdbc/TestDB" ./conf/Catalina/localhost/test001.xml > tmp1.txt
$ grep -A24 "jdbc/DbcpTestDB" ./conf/Catalina/localhost/test001.xml > tmp2.txt
$ diff tmp{1,2}.txt
1c1
<   <Resource name="jdbc/TestDB"
---
>   <Resource name="jdbc/DbcpTestDB"
4c4
<             factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
---
>             factory="org.apache.commons.dbcp.BasicDataSourceFactory"

$ rcsdiff /etc/config-archive/etc/conf.d/tomcat-7-7.0.42-main,v /etc/conf.d/tomcat-7-7.0.42-main
===================================================================
RCS file: /etc/config-archive/etc/conf.d/tomcat-7-7.0.42-main,v
retrieving revision 1.2
diff -r1.2 /etc/conf.d/tomcat-7-7.0.42-main
19c19
< TOMCAT_EXTRA_JARS="jdbc-mysql"
---
> TOMCAT_EXTRA_JARS="jdbc-mysql,commons-pool,commons-collections,commons-dbcp"

0 件のコメント: