哪些关系数据库具有高级语言的公共 API?

发布于 2024-08-26 04:12:30 字数 1539 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

因为看清所以看轻 2024-09-02 04:12:30

您可能需要查看以下维基百科文章,了解关系数据库的 SQL 接口替代方案列表:

该列表包括(按字母顺序排列):

You may want to check out the following Wikipedia article for a list of interfacing alternatives to SQL for relational databases:

The list includes (in alphabetical order):

萌面超妹 2024-09-02 04:12:30

有用于 .NET/C# 的 LINQ。其示例如下:

var results = from row in db.SomeTable
              where row.Key == 23
              select row;

您可以像这样用“自然”C# 编写(也就是说,上面是语法糖):

var results = db.SomeTable.Where(row => row.Key == 23);

There is LINQ for .NET/C#. An example of what that would look like is:

var results = from row in db.SomeTable
              where row.Key == 23
              select row;

Which you can write in "natual" C# like so (that is, the above is syntactic sugar for):

var results = db.SomeTable.Where(row => row.Key == 23);
吻风 2024-09-02 04:12:30

JDBC 和 ODBC 已经满足您的需要。
尝试查看光标,例如 这个

例如,语法不会像 LINQ 中那样紧凑,但您将获得能够迭代的行。

您可能还想检查对象关系映射,因为我认为这就是您的情况最终寻找。

此外,您可能会发现 LINQ 和其他方法在单行更新和简单检索方面工作得很好,但对于一般数据库工作(多行更新、复杂检索、聚合等),没有什么比 SQL 更好的了。 SQL 是并且将是与 RDBMS 通信的最自然的方式,因为它是 RDBMS 的本机语言。

如果您不想使用 SQL,则必须使用
a) 此处此处。请记住,这些是映射到 SQL 的成熟 API,最终它们并不简单,而且它们的范式不同,通常不那么有效(对于 RDBMS 来说不自然)。
b) 编写您自己的数据抽象层(可能使用 a 中提到的框架之一),为您的对象提供与数据库对话的自然方法。通过这种方式,您将获得两全其美的效果,并且正是您所需要的。尽管这在较大的项目中确实很出色。

JDBC and ODBC already have what you need.
Try looking at cursors, for example this.

The syntax will not be as compact as in LINQ for example, but you'll get your rows through which you'll be able to iterate.

You might also want to check for object relational mapping, because I assume that's what you are ultimately looking for.

Furthermore, you will probably find that LINQ and other approaches work well with single row updates and with simple retrievals, but that for general database work (multiple row updates, complicated retrievals, aggregates, etc) there is nothing like SQL. SQL is and will be the most natural way to communicate to RDBMS, since it is the native language for RDBMS.

If you don't want to use SQL you will have to either use
a) one of approaches described at here or here. Keep in mind that these are full blown API's which map to SQL and that at the end they are essential no simpler and where they differ in pardigm, usually not as effective (unnatural fro RDBMS).
b) Write your own data abstraction layer (possibly using one of the frameworks mentioned under a) providing natural methods for your objects to talk to the database. This way you'll get the best of both worlds and exactly what you need. Although this really shines in larger projects.

鹿! 2024-09-02 04:12:30

我正在寻找的东西称为 ISAM,正如 Neil Butterworth 正确指出的那样。

因此,维基百科文章 http://en.wikipedia.org/wiki/Isam 给出了一些观点开始进一步的研究。

如果您碰巧发现这有用,请为上面的尼尔斯评论投票。

The stuff I was looking for is called ISAM as correctly pointed out by Neil Butterworth.

So the wikipedia article http://en.wikipedia.org/wiki/Isam gives some points to start further research.

If you happen to find this useful please upvote Neils comment above.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文