.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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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

    - Using CrystalReportViewer to Display Crystal...
    - Creating Summary .Net Crystal Reports
    - More on Commands, Input and the WPF
    - Grouping and Aggregating When Querying LINQ ...
    - Commands, Input and the WPF
    - Keyboard and Ink Input with WPF
    - Mouse Input and the WPF
    - Input with Windows Presentation Foundation
    - Introducing LINQ with XML and Databases
    - An Introduction to LINQ
    - Querying LINQ to SQL: Basics
    - Completing a Simple Storefront with LINQ
    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries

     
    Best Practices for Windows Vista Migration Presentation
    Dell and Microsoft recently held a series of face-to-face seminars entitled, &qu....

     
    Creating a Culture for Code Reuse
    If you oversee development teams you know that like it or not proprietary and ex....

     
    Keys to Web Application Acceleration: Advances in Delivery Systems
    Accelerate Web apps by up to 5x. Ensure significantly faster access to the Web a....

     
    Optimizing Application Monitoring
    Tired of finding out from your customers that you're offline? This white paper e....

     
    Solaris to Solaris Migration -- Migrating applications from Sun SPARC to Dell PowerEdge R900
    This comprehensive Migration Guide reviews the approach that Principled Technolo....

     




    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT