数据表相当于在Java中数据表、Java

2023-09-02 21:20:03 作者:京华倦客

有一个C#的DataTable相当于在Java中?

Is there a C# DataTable equivalent in Java?

推荐答案

一个类似的问题已经被问最近的。结果集肯定是不直接等同,因为它只有到数据库的有效连接工程,而一个DataTable可以用脱机。

A similar question that has been asked recently. ResultSet certainly is not a direct equivalent as it only works with an active connection to the database while a DataTable can be used "offline".

从个人的经验,我会说没有直接等同于Java的(没试过 javax.sql.rowset.WebRowSet中,虽然)。与普通的SQL要么你去 java.sql.ResultSet中的是你的朋友。或者你使用一些ORM工具如Hibernate,卡宴,Toplink的仅举几例。或者你建立你自己的(不,我鼓励这一点,但我觉得在多个项目已顺利完成)。

From personal experience I would say there is no direct equivalent in Java (haven't tried javax.sql.rowset.WebRowSet, though). You either go with plain SQL and java.sql.ResultSet is your friend. Or you use some ORM tool like Hibernate, Cayenne, Toplink to name a few. Or you build your own (not that I encourage this, but I think on more than one project that has been done successfully).