我已经把我的邮件从gmail账户拿到了本地的zimbra机器上,它存储在mysql数据库中,mysql数据库在7306端口和/opt/zimbra/db/mysql.sock上运行mysql。
现在,我想通过java程序访问所有这些记录。
我使用了spring和java程序,使用的是zimbra java版本1.7.0\u07-b10
这是xml文件中的配置。。
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://172.18.100.117:7306/mboxgroup8?socket=/opt/zimbra/db/mysql.sock"/>
<property name="username" value="zimbra"/>
<property name="password" value="Zy"/>
<property name="maxActive" value="10"/>
<property name="maxIdle" value="5"/>
<property name="maxWait" value="60000"/>
<property name="removeAbandoned" value="true"/>
<property name="removeAbandonedTimeout" value="60"/>
<property name="logAbandoned" value="true"/>
<property name="validationQuery" value="Select 1"/>
<property name="testOnBorrow" value="true"/>
<property name="testWhileIdle" value="true"/>
<property name="timeBetweenEvictionRunsMillis" value="10000"/>
<property name="minEvictableIdleTimeMillis" value="60000"/>
</bean>
当我试图通过程序连接,它给我下面的错误。。。
getMails- 59- Exception in getMails at Manager:org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:182)
at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:219)
at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:266)
at com.cashEmail.core.dao.MailItemDAOImpl.selectByExampleWithBLOBs(MailItemDAOImpl.java:86)
at com.cashEmail.manager.CashManager.getMails(CashManager.java:48)
at com.cashEmail.core.service.CashService.getCashEmail(CashService.java:77)
at com.cashEmail.resource.CashResource.getEmails(CashResource.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
暂无答案!
目前还没有任何答案,快来回答吧!