连接两个数据库 [英] connecting two databases

查看:80
本文介绍了连接两个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有msaccess数据库(由其他人使用)以及sql db(我的数据库),每当访问数据库获得行或数据INSERTED时,我希望我的数据库插入相同的行或数据





实际上我需要一个触手可及的东西但是它可能会在访问中获得





注意:我无法控制msaccess数据库。





请帮我解决简单的解决方案??



提前感谢

Am having a msaccess db(used by others) and also a sql db(my db) too, whenever access database got row or data INSERTED, i want my db inserted with same row or data


ACTUALLY I NEED A TRIGGER KIND OF THING BUT IT WONT B POSSIBLE IN ACCESS


Note: am not having the control over that msaccess db.


Please help me with simple solutions if any??

thanks in advance

推荐答案

A)你需要创建日志



为了创建日志,您可以创建一个包含3个信息和同步标志的通用表格

- 表格名称

- 主键(记录)确定)

- 动作(插入/更新/删除)

- 插入时同步(Y / N)〜默认为'N'<​​br />


您可以使用触发器进行插入





B)您需要一个独立的应用程序是的以特定间隔一直运行,读取此日志并使用JDBC连接到您选择的数据库并复制信息。在复制时,要么删除记录,要么将Sync标记标记为Y
A) You need to create logs

For creating log you may create a generic table with 3 information & Sync flag
- Table name
- Primary Key (record identified)
- Action (Insert / Update / Delete)
- Sync (Y/N) ~ default during insert as 'N'

You can use triggers for doing an insert for


B) You will need an stand alone application which is running all the time at specific interval read this logs and connects to your choice of DB using JDBC and replicates information. On replication, either deletes the record or marks Sync flag as "Y"


这篇关于连接两个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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