使用MS Access DB部署Java桌面应用程序 [英] Deploy Java Desktop Application with MS Access DB

查看:171
本文介绍了使用MS Access DB部署Java桌面应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第一次使用MS Access DB部署Java桌面应用程序,发现JAR软件包没有获得数据库访问权限,除了我的开发PC,尽管我在JAR文件的同一目录中有MS访问数据库我已经在构建应用程序后复制了。而且我明白我无法连接使用我的PC的ODBC连接创建的MS访问数据库。现在我的问题是



如何部署具有MS访问权限的Java桌面应用程序BD,这些应用程序将运行在任何一台计算机上,每台计算机都将手动ODBC连接到每台计算机的MS ACCESS DB需要?



我没有尝试在网络工作中连接MS访问数据库,而是尝试运行此应用程序,其中已安装MS Access DB,并且我提供的数据库将与JAR文件,我想访问我从Java前端应用程序提供的数据库。



请帮助。

解决方案

首先您应该获取Access数据库的ODBC驱动程序。有些电脑可能没有。



安装该驱动后,您应该在计算机上创建ODBC数据源。我不知道如何在Java中执行,但ODBC数据源配置存储在注册表中,您可以添加您的数据源。



Google注册表添加odbc数据源或我可以使用脚本创建和删除DSN(第二个是我发现的好文章的标题。



可能您可以从java访问注册表而没有任何问题



您还可以使用其中一个安装程序程序,其中一些具有添加数据源功能。


This is the first time I am going to deploy the Java Desktop Application with MS Access DB and discovered JAR package is not getting database access other then my development PC though I had the MS access DB in the same directory of the JAR file I have copied after Build the application. And I understand that I cannot connect MS access DB I created with ODBC connection of my PC. Now my question is

How can I deploy Java Desktop Application with MS access BD which will run in any computer where manual ODBC connection to the MS ACCESS DB for every computer will not require ?

I am not trying to connect MS access DB within a net work rather I am trying run this app where MS Access DB is already installed and my supplied DB will be with the JAR file and I want to access the DB I have provided from Java Front End Application.

Please help.

解决方案

First you should get ODBC driver for Access database. Some computers may don't have it.

After you install that driver you should create ODBC Data Source on computer. I have no idea how to do it in Java, but ODBC Data Source configurations are stored in registry and you can add your Data Source.

Google "registry add odbc data source" or "Can I Create and Delete a DSN Using a Script" (second one is title of good article i found.

Probably you can access registry from java without any problems.

You can also use one of install-maker programs. Some of them have something like "Add Data Source" functionality.

这篇关于使用MS Access DB部署Java桌面应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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