.NET
  Home arrow .NET arrow Page 4 - Providing a Complete Data Persistence Solu...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

Providing a Complete Data Persistence Solution
By: Dwight Peltzer
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 5
    2005-04-27

    Table of Contents:
  • Providing a Complete Data Persistence Solution
  • A Mapping Architectural Overview
  • Mapping Tool Types
  • Writing XML, Reading from Java

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Providing a Complete Data Persistence Solution - Writing XML, Reading from Java


    (Page 4 of 4 )

    JSQLMapper also provides the capability for writing XML to a database from the GUI as well as reading data from a Java program. A single class called JSQLMapper reads, writes, and deletes database data. Before you use JSQLMapper, you must import the following libraries and place them in your classpath: 

    • sqlmapper.jar from the "lib" directory located in the install directory. 
    • castor-0.9.3.21.jar
    • hsqldb.jar
    • xercesImpl.jar
    • xmlParserAPIs.jar

    The following example demonstrates how to read from a file:

    package com.jnetdirect.sqlmapper.tutorial;
    import java.io.*;
    import java.sql.*;

    //import the JSQLMapper classes
    import com.jnetdirect.sqlmapper.*;

    public class ReadTutorial
    {
      public ReadTutorial()
        {
        }
      public static void main(String[] args) Throws
    Exception
      {
        class.forName(“org.hsqldb.jdbcDriver”);
        Connection cn = DriverManager.getConnection
          (“jdbc:jsqldb:hsql://localhost”, “sa”, ““);
      //create an instance of the JSQLMapper class
        JSQLMapper sqlmapper = new
          JSQLMapper(new FileInputStream(“invoice. map”); 
        sqlmapper.read(cn, new FileOutputStream (“invoices.xml”)); 
        cn.close();
        }
    }

    Hopefully, this article will provide some stimulus for reaching out and leveraging JNetDirect’s JSQLMapper’s technology. JSQLMapper is fully J2EE compliant and is an invaluable third party business solution for bridging between Java’s J2EE specifications and .NET’s. exciting new technology. Happy computing!

    References

    • Patterns of Enterprise Application Architecture, Martin Fowler, 2003, Pearson Education
    • Design Patterns, Gamma, 1995, Addison Wesley Longman
    • The Unified Modeling Language User Guide, Booch, Rumbough, Jacobson, 1999, Addison Wesley
    • .NET & J2EE Interoperability, Dwight Peltzer, 2004, McGraw-Hill/Osborne
    • Database Programming with JDBC and Java, Reese, 2000, O’Reilly
    • JNetDirect JSQLMapper API and Documentation, 2004, Doug Crane/Burke Cox
    • Java 2 Enterprise Edition (J2EE) Specification 1.4
    • JDBC Specification 3.0

    (This article appeared, in a slightly altered form, in the May 2004 issue of Plug in).


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    .NET ARTICLES

    - Building Applications with Windows Workflow ...
    - Building the Data and Business Layers Using ...
    - The Transformed XML Explorer in MFC
    - List Control and Property Grid with the MFC ...
    - Font, Shell and Masked Edit Controls for MFC
    - Color, Link and Image Editor Controls for M...
    - New Controls for MFC
    - The Windows Ribbon Framework
    - Markup Language for the Ribbon Framework
    - Visually Upgrade Your MFC Project
    - New Features for the Statusbar in MFC
    - Working with the Statusbar in MFC
    - Iron Speed Design v60 Review
    - Binary and XML Serialization
    - Using CrystalReportViewer to Display Crystal...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek