如何为Java桌面应用程序将Access数据库共享到其他PC? [英] How to share an Access database to different pc's for a Java desktop application?

查看:187
本文介绍了如何为Java桌面应用程序将Access数据库共享到其他PC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用JAVA(RCP插件)创建一个桌面应用程序,并且正在使用MS Access作为应用程序的数据库.

I am creating a desktop application in JAVA (RCP plugin) and I am using MS Access as database for my application.

我将数据库文件保存在某个共享位置,但是每当我尝试从其他计算机打开它时,都会引发异常,表明数据库已被其他人锁定. 请让我知道如何解决此问题.

I kept database file on some shared location but whenever I try to open it from different machine it throws exception saying database is already locked by someone else. Please let me know how to resolve this issue.

是否可以使用JDBC连接在不同计算机之间共享MS Access数据库文件?

Is there any way to share an MS Access database file between different machine using JDBC connectivity?

推荐答案

否.这就像将您的汽车交给几个人,而所有人都希望同时开车:出于多种原因,它无法正常工作.

No. This is like giving your car to several people and all of them want to drive it at the same time: It won't work for many reasons.

解决方法:

  1. 使用MySQL或H2之类的真实数据库.

  1. Use a real database like MySQL or H2.

创建一个与Access数据库对话的Java服务器.让所有其他程序与该服务器通信.

Create a Java server which talks to the Access database. Let all the other programs talk to this server.

注意:使用方法2时,不能在其他程序"中使用JDBC.您必须编写自己的协议.

Note: You can't use JDBC in the "other programs" when you use approach #2. You'll have to write your own protocol.

这篇关于如何为Java桌面应用程序将Access数据库共享到其他PC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆