15

Does anyone know if there is a DataSet class in Java like there is in .Net? I am familiar with EJB3 and the "java way" of doing data. However, I really still miss the seamless integration between database queries, xml and objects provided by the DataSet class. Has anyone found a Java implementation of DataSet (including DataTable, DataRow, etc)?

Edit: Also if anyone has tutorials for the java flavor of DataSet, please share a link.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
User1
  • 39,458
  • 69
  • 187
  • 265

9 Answers9

3

Have you looked at javax.sql.rowset.WebRowSet?

From the Javadocs:

The WebRowSetImpl provides the standard reference implementation, which may be extended if required.

The standard WebRowSet XML Schema definition is available at the following URI:

   http://java.sun.com/xml/ns/jdbc/webrowset.xsd

It describes the standard XML document format required when describing a RowSet object in XML and must be used be all standard implementations of the WebRowSet interface to ensure interoperability. In addition, the WebRowSet schema uses specific SQL/XML Schema annotations, thus ensuring greater cross platform inter-operability. This is an effort currently under way at the ISO organization. The SQL/XML definition is available at the following URI:

   http://standards.iso.org/iso/9075/2002/12/sqlxml
Nick Holt
  • 33,455
  • 4
  • 52
  • 58
3

you may want to look into this open-source library:

https://www.developerfusion.com/project/20506/casperdatasets/

Its easy to use (a lot like using the sql resultset), and its all in-memory. it also supports complex queries and indexes on your data.

bkwdesign
  • 1,953
  • 2
  • 28
  • 50
jli_123
  • 215
  • 1
  • 4
1

Check:

http://download.oracle.com/docs/cd/E17802_01/j2se/javase/6/jcp/beta/apidiffs/java/sql/DataSet.html

0

ResultSet like rexem commented above. Would you like to elaborate on what you consider the Java way of doing data and how it differs from the C# way?

Markus Koivisto
  • 609
  • 3
  • 6
  • 3
    ResultSet is much more like .NETs DataReader, which are very different things compared to DataSets/DataTables – nos Jul 28 '09 at 17:34
0

I know what you mean by the "dataset way" maybe you can find something similar, however are you sure you want to go that way? Java has many options but if you want something more cooked, why don't explore hibernate, it's the very popular in the industry and will give you more power that the one you are asking for.

MexicanHacker
  • 2,685
  • 3
  • 19
  • 20
0

You might be looking for LINQ implementation in Java. IMHO better than the DataSet/DataTable route.

http://code.google.com/p/jaque/

http://quaere.codehaus.org/

Disclaimer: I haven't used either of these.

Axl
  • 8,272
  • 2
  • 26
  • 18
0

MetaData

http://java.sun.com/products/jmi/index.jsp

0

I'm an author of ExDataSet. If you need a way to send DataSet from java/android application to .NET the web service, you should take a look on this library. It is 100% fully compatible in xml representation with .NET DataSet objects and supports sending tables, rows, relations, foreign and unique keys, nested tables etc.

robocik
  • 101
  • 7
  • 20
0

Made one myself. Only have DataTable and DataRow, and might be incomplete. Check:

https://github.com/fandisus/javatrustlib

Fandi Susanto
  • 2,272
  • 1
  • 26
  • 25