Re: JDBC vs Hibernate



Sandy wrote:

How about using OPENXML vs JDBC (performance wise)
I read somewhere that OPENXML is faster, (I have the XML file in memory
already, my application is generating an XML file)

Is it a better option than writing data Row by Row in tables.

So I can use it likle this
String exec =
        "DECLARE @_hDoc int "+
        "EXEC sp_xml_preparedocument @_hDoc OUTPUT, "+
        "N'<ROOT> "+
        " <DataSource Device=\"D1\" Community=\"PUBLIC\" > "+
        " </DataSource> "+
       "</ROOT>'" +
        "INSERT DataSource SELECT * FROM OPENXML(@_hDoc,
N'/ROOT/DataSource') WITH DataSource "+
        "EXEC sp_xml_removedocument @_hDoc";

Statement s = connection.createStatement();

I haven't the faintest idea. FWIW, I'm not at all convinced that it's a good idea to store raw XML in a database except in very limited cases.


If you want to discuss JDBC vs OpenXML, I suggest you start a new thread. Perhaps somebody with OpenXML qualifications will see fit to make a contribution.

Luke
.



Relevant Pages

  • Problem with OPENXML
    ... I'm trying to open an XML file with OPENXML. ... The error description is 'The following tags were not closed: gpx, rte, ... WITH (lat float, ...
    (microsoft.public.sqlserver.xml)
  • Re: What is fastest way to insert many records into a SQL server database?
    ... To use OPENXML do I have to output an XML file to be imported by SQL Server ... (in much the same way as the BULK INSERT method) ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: HOW I CAN SAVE AN XML IN SQL SERVER
    ... Do you want to shred it into rows/columns or store it as blob? ... If you want to shred it, you may use OpenXML or Dataset. ... consider using Bulkload which will stream the date to SQL server. ... >I HAVE AN APP THAT RECEIVE FROM THE WEB A XML FILE ...
    (microsoft.public.sqlserver.xml)
  • OPENXML
    ... Is there a way to use read data from an XML file, ... The code example below is from BOL using OPENXML, ... EXEC sp_xml_preparedocument @hDoc OUTPUT, ... INSERT Customers ...
    (microsoft.public.sqlserver.programming)
  • Re: datagrid update command
    ... > -i updated the dataset with the str and i wrote the dataset to xml file ... > -i used the debugger to watch str and the same result here ... i have to update the datasource with the dataset every time i need ...
    (microsoft.public.dotnet.framework.aspnet)