无DSN创建运行Swing应用程序 [英] run swing application without DSN creation

查看:137
本文介绍了无DSN创建运行Swing应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在没有在客户端上创建DSN运行Swing应用程序

How to run the swing application without creating the DSN on the client

我的工作中,我得给MDB数据库到Swing应用程序
具有密码保护客户端,我不想需要在客户端创建DSN

I am working on a swing application in which i have to give the mdb database to the client with password protection , i dont want the need to create DSN on client side

是否有任何可能的方式给在编码部分数据库路径,而不是
指定DSN名称。因为DSN的创建是客户端复杂的任务。

Is there any possible way to give the database path in the coding part rather than specifying the DSN name. because DSN creation is a complicated task for client.

推荐答案

低于code使用创建连接:

USE below code to create your connection:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\\as\\sampleDB.mdb");

这可能会帮助你。

这篇关于无DSN创建运行Swing应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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