As said in the user guide, when using a jdbc driver directly, the *jdbc
property* "driver" should be added with the class of the real driver for
value.
In this case, you have a property "driver" in your dbconfig.properties
file, but you do nothing with it.
I think that for BoneCP, you need to add the following lines in your
getBoneCpConfig():
Properties driverProperties = new Properties();
driverProperties.put("driver", dbConfig.getString("driver"));
bonecpConfig.setDriverProperties(driverProperties);
Let us know if this work.
bye,
Emeric
Le 25/03/2012 01:36, 锟斤拷MM锟斤拷锟斤拷 a 锟斤拷crit :
> path:
> WEB-INF/dbconfig.properties
> content:
> jdbc.type=mysql
> jdbc.driverClassName=net.bull.javamelody.JdbcDriver
> driver=com.mysql.jdbc.Driver
> jdbc.url=jdbc:mysql://127.0.0.1/fds
> jdbc.username=root
> jdbc.password=123456
>
> boneCP.idleMaxAge=10
> boneCP.idleConnectionTestPeriod=10
> boneCP.partitionCount=3
> boneCP.acquireIncrement=10
> boneCP.maxConnectionsPerPartition=10
> boneCP.minConnectionsPerPartition=10
> boneCP.preparedStatementCacheSize=10
> boneCP.statementsCachedPerConnection=10
> boneCP.releaseHelperThreads=3
>
> javacode:
> /**
> * 锟斤拷锟斤拷锟捷匡拷锟斤拷锟斤拷
> * @return
> * @throws ConfigurationException
> * @throws SQLException
> * @throws ClassNotFoundException
> */
> public static Connection getConnection() throws
> ConfigurationException, SQLException, ClassNotFoundException{
> if(connectionPool==null){
> connectionPool= new BoneCP(ConfigFactory.getBoneCpConfig());
> }
> return connectionPool.getConnection();
> }
> ConfigFactory.getBoneCpConfig():
> /**
> * 锟斤拷取bonecp锟斤拷锟斤拷锟斤拷息