如何通过java编程创建DSN! [英] How TO create DSN through the java programing!

查看:152
本文介绍了如何通过java编程创建DSN!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里我不希望任何连接字符串将数据库连接到我的程序bcoz我知道DSN与数据库的连接较少。



i想要代码通过Java编程创建DSN ......!







谢谢你,

Vishal P.

Here i dont want any connection string to connect database to my program bcoz i know the DSN less connection to the database.

i want the code for create DSN through Java programing...!



Thanks Regards,
Vishal P.

推荐答案

所有DSN(系统和用户)都在注册表中写入。使用 odbcad32.exe 创建DSN [ ^ ]申请并检查注册表项 [ ^ ];)



这是一个示例代码:请参阅: https://forums.oracle.com/forums/thread.jspa?threadID=1322637 [ ^ ]
All DSN (System and User) are writen in registry. Create DSN using odbcad32.exe[^] application and check registry entry[^];)

Here is an example code: See this: https://forums.oracle.com/forums/thread.jspa?threadID=1322637[^]


我们还想要很多东西我们不能得到:(

两句话没有任何共同点。

1)连接字符串有什么问题?你不需要对它们进行硬编码,甚至在java周围也有配置文件。你甚至可以访问注册表。

2)即使微软建议不使用系统dsn

3)尽可能避免使用odbc和java,使用jdbc

4)我怀疑你能用纯java创建系统dsn(除非你修改注册表 [ ^ ]直接) - 我可能错了

5但是,您可以简单地创建和维护文件dsns。请看这里: http://support.microsoft.com/kb/165866 [ ^ ]
We also want many things we can''t get :(
The two sentences have nothing in common.
1) What is wrong with connection strings? You don''t need to hardcode them, there are configuration files even around java. You can even access registry.
2) Even Microsoft recommends not using system dsn
3) When possible avoid using odbc with java, use jdbc
4) I doubt you will be able to create system dsn with pure java (unless you modify the registry[^] directly) - I might be wrong
5) You can however simply create and maintain file dsns. Look here: http://support.microsoft.com/kb/165866[^]


这篇关于如何通过java编程创建DSN!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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