We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
您可能需要查看以下维基百科文章,了解关系数据库的 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):
有用于 .NET/C# 的 LINQ。其示例如下:
您可以像这样用“自然”C# 编写(也就是说,上面是语法糖):
There is LINQ for .NET/C#. An example of what that would look like is:
Which you can write in "natual" C# like so (that is, the above is syntactic sugar for):
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.
我正在寻找的东西称为 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.