Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Spring数据源:-您的网络访问被中断_Java_Spring_Ms Access_Spring Mvc_Jdbc Odbc - Fatal编程技术网

Java Spring数据源:-您的网络访问被中断

Java Spring数据源:-您的网络访问被中断,java,spring,ms-access,spring-mvc,jdbc-odbc,Java,Spring,Ms Access,Spring Mvc,Jdbc Odbc,我创建了一个SpringWeb应用程序,用于读取ms access大型数据库文件。有时,由于文件太大,此文件会被修复。压缩数据库文件之前,关闭所有打开的会话。当我们从SpringWeb应用程序连接到数据库时,关闭会话并修复数据库之后,我得到以下错误 HTTP Status 500 - Request processing failed; nested exception is org.springframework.dao.TransientDataAccessResourceExcept

我创建了一个SpringWeb应用程序,用于读取ms access大型数据库文件。有时,由于文件太大,此文件会被修复。压缩数据库文件之前,关闭所有打开的会话。当我们从SpringWeb应用程序连接到数据库时,关闭会话并修复数据库之后,我得到以下错误

 HTTP Status 500 - Request processing failed; nested exception is 
 org.springframework.dao.TransientDataAccessResourceException: PreparedStatementCallback; 
 SQL [select [DateTimeEntered],[GoodWeight],[MachineSpeed],[GradeCode],[RejectedWeight] 
 from [tblMachineProduction] where [DateTimeEntered] between ? and ? order by 
 [DateTimeEntered]]; [Microsoft][ODBC Microsoft Access Driver] Your network access was 
 interrupted. To continue, close the database, and then open it again.; nested exception 
 is java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Your network access 
 was interrupted. To continue, close the database, and then open it again.
如何处理此异常或如何重新加载/初始化数据源

Spring代码如下:-

<bean id="dataSource" scope="prototype" class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <property name="driverClassName" value="${jdbc.driverClassName}" />
    <property name="url" value="${jdbc.database.url}" />
    <property name="username" value="${jdbc.username}" />
    <property name="password" value="${jdbc.password}" />

    <property name="testOnBorrow" value="true"/>
    <property name="testOnReturn" value="true"/>
    <property name="testWhileIdle" value="true"/>

</bean>