Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Database/JDBC/SQL/JDO/Hibernate » Other DB  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 急!!JDBC如何连接另外一台电脑上的Access数据源?
centy





发贴: 4
积分: 0
于 2006-06-05 15:43 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我现在遇到这样一个需求,就是Access数据库在另外一台电脑上,建立数据源,我怎么用jdbc:odbc连接到到那个数据源上呢?


作者 Re:急!!JDBC如何连接另外一台电脑上的Access数据源? [Re:centy]
jameszhang



CJSDN高级会员


发贴: 1594
积分: 111
于 2006-06-05 19:23 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
就是Access数据库在另外一台电脑上 建立各 WebServer 然后在上面 部署各webservice 功能就是 接受sql请求,返回 结果集 ,也不用 JDBC了,用URL 就可以了,方便啊!哈哈,其实我就没明白,为什么跟一个文件数据库 较劲?


"First they ignore u, then they laugh at u, then they fight u, then u will win

Mahatma Gandhi"

作者 Re:急!!JDBC如何连接另外一台电脑上的Access数据源? [Re:centy]
centy





发贴: 4
积分: 0
于 2006-06-06 18:24 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
谢谢jameszhang!
能否给个小例子呢?我不是太清楚你说的。公司给我的任务,而且必须是Access,实在没办法啊:(



作者 Re:急!!JDBC如何连接另外一台电脑上的Access数据源? [Re:centy]
jameszhang



CJSDN高级会员


发贴: 1594
积分: 111
于 2006-06-06 18:31 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
如果你认为这是可行的需要 :
1。 建立 WebServer : Tomcat 就可以 了

2。 建立 WebService 服务 : 具体例子 论坛上 搜索

3。 写个 服务接口 ,这个根据你的实际情况

4。 客户端用 用 URL 访问

最好有其他方法,呵呵



"First they ignore u, then they laugh at u, then they fight u, then u will win

Mahatma Gandhi"

作者 Re:急!!JDBC如何连接另外一台电脑上的Access数据源? [Re:centy]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2006-06-06 21:47 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
> 最好有其他方法
If it is a local network, you could try to use mapped drive, UNC path or DSN, i.e.
"jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=M:\\test.mdb"
"jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=//192.168.1.123/folder/test.mdb" (may not be correct)
"jdbc:odbc:DSNname"



作者 Re:急!!JDBC如何连接另外一台电脑上的Access数据源? [Re:centy]
jigsaw

KK

CJSDN高级会员


发贴: 3666
积分: 93
于 2006-06-07 13:41 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
啊?webservice都来啦?呵呵


No one knows except both of us.
909090909090909090909090909090909090909090b8533ce76c8d6c241868968a0408c338b4ffbf
ISO/IEC 9899:1999
作者 Re:急!!JDBC如何连接另外一台电脑上的Access数据源? [Re:centy]
centy





发贴: 4
积分: 0
于 2006-06-07 16:27 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我把why给的第二种方法改变了一下,把另外一台方Access数据库的文件夹共享,在设置ODBC时,在选择数据库的地方选择“网络”,找到那个共享文件夹,呵呵,大功告成!谢谢jameszhang、why等的帮助!



flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923