Is DataSet in .Net same as resultSet in java?



  • What is DataSet and DataTable?

    Why do .nEt programmers need so many different objects, thus confusing life for expert java programmers like me?
    A person with experience on .NEt has joined our team.

    He is asking lots of questions.

    also he harass everyone saying java less power than .NET



  • @Nagesh said:

    What is DataSet and DataTable?

    Why do .nEt programmers need so many different objects, thus confusing life for expert java programmers like me?
    A person with experience on .NEt has joined our team.

    He is asking lots of questions.

    also he harass everyone saying java less power than .NET

    A DataSet can contain more than one DataTable.

    It's designed for use with SQL queries, where a single query can return multiple results.

    If Java doesn't have an object equivalent to DataSet, then it *is* less powerful than .net. (If it does, then it's not. I dunno Java, just being snarky.)

    EDIT: Ok, I actually looked it up. It looks like ResultSet in Java is the equivalent to DataTable in .net. Which still leaves a mystery (to me) whether Java has an equivalent to DataSet...? What's really weird is that getResultSet() specifically says it can only be called once per query: "Retrieves the current result as a ResultSet object. This method should be called only once per result." So... what happens if the query returns 4 ResultSets? How do you get at them?

    ANOTHER EDIT: Oh nevermind, I see now: getNextResult(). Sorry, Nagesh, I think .net has the cleaner design here. I bet the Java folks coded it assuming 1 query = 1 result, and then had to quickly patch on "getNextResult()" when someone pointed out the problem. Probably by one of the depressingly-common coders who has zero SQL experience, yet still writes database code.



  • Java's ResultSet is very similar to the old RecordSet from the pre-.Net days.  If it is forward-only, then its functionally similar to a DataReader.  If it is scrollable, then it is similar to a DataTable.  Unlike the DataTable/DataAdapter combo, it cannot do batch updates.  The more I look into it, the more it looks exactly the Microsoft's state of the art circa 1996.  ADO RecordSet (from 1996) also has a NextRecordSet method that works exactly like Java's getNextResult.


  • Garbage Person

    @blakeyrat said:

    Oh nevermind, I see now: getNextResult(). Sorry, Nagesh, I think .net has the cleaner design here. I bet the Java folks coded it assuming 1 query = 1 result, and then had to quickly patch on "getNextResult()" when someone pointed out the problem. Probably by one of the depressingly-common coders who has zero SQL experience, yet still writes database code.
    Oddly enough, I've had team members say "why the hell do I keep needing to pulling DataTables out of these DataSets?" only to stare blankly when I tell them you can get more than one result in a query and look at me like I'm a goddamned wizard when I show them the code that grabs datasets to feed into CrystalReports - "but how are you getting all those different tables into that dataset?!".

     

    Now if only we had SqlCommand.executeDataSet() to go straight into one from the query. There is one, but it's in the Data Access application block library, not the framework itself.



  • @Nagesh said:

    What is DataSet and DataTable? Why do .nEt programmers need so many different objects, thus confusing life for expert java programmers like me? A person with experience on .NEt has joined our team.

    He is asking lots of questions.

    also he harass everyone saying java less power than .NET

     

    For data access and desktop applications Java is less powerful, and typically slower  than .NET, depending on the specific requirements of the application at hand and the target environment.

    I could state the obverse and it would be equally true.

    For data access and desktop applications .NET is less powerful, and typically slower  than Java, depending on the specific requirements of the application at hand and the target environment.

    In the hands of an expert Java programmer the second statement is true.  In my hands the first statement is true (for VB.NET).  If we both ran tests at the same time it might result in either a tie, or egg on my face, or a collapse of the space time continuum. 

    *** Warning - Trolling follows *** 

    Now, in my personal opinion,  Java is the most horrible language on earth, with the worst development tools. I prefer verbose code and verbose constructs.  I REALLY hate C and it's derivatives.

    Kudos to you for being able to use it (Java) without going insane.

    I expect you'll switch to another environment as soon as Oracle clamps the licensing down on Java to match the Oracle prices and "enhance" Java to meet Oracle's strict adherence to anti-quality and anti-standards.


Log in to reply