How to Configure DAO for XML Documents?

Asked By 10 points N/A Posted on -
qa-featured

Hi Everyone in TechyV!

Can anyone please tell me the configuration of DAO for XML Documents? I need to configure DAO using Java and I need help from anyone who knows DAO. Please share your expertise and knowledge. It would be very helpful if you can provide tutorials for beginners or any books or ebooks. I really appreciate any help from anyone.

Thank you.

Amanda Wissler 

SHARE
Best Answer by Clayton Freda
Answered By 0 points N/A #144472

How to Configure DAO for XML Documents?

qa-featured

Hi,

To solve this problem, I suggest you do the following :

1. Try to create an interface for example :

public interface ArticleDAO {
  public int insertArticle(...);
  public Article findArticle(...);
  public boolean updateArticle(...);
  public boolean deleteArticle(...);
  ...
}

2. Implement the interface with a class (ArticleADOXML) which you can add a String or File to indicate the path where you want to write your XML files.

3. Add the framework XStream (https://github.com/codehaus/xstream) in the build path to serialize objects as XML files and you can implement the methods the way you like .

This is a tutorial for XStream framework that could help .You can use also the "Castor" framework.

you can check here an example of an XML config file for DAO framework.

Best Answer
Best Answer
Answered By 0 points N/A #144473

How to Configure DAO for XML Documents?

qa-featured

Hello,

The iBatis structure is a light details applying structure and persistence API that can be used to quickly make use of a heritage information source schema to produce information source persistence part for your Java program. A set of XML secured SQL Map files–one for each information source table–holds SQL themes that are implemented as prepared claims and map the predicted outcomes to Java website sessions.From program code, a part of the iBatis Data Access object (DAO) functions as the API that carries out the SQL Map layouts and designates the outcomes of the corresponding Java sector sessions. Therefore, the structural collection looks like this:

This guide will show how to instantly generate the program code for these three levels from a current data source. To enable connection between these levels, an XML settings computer file explains each DAO interface and execution class, as well as the location of a second XML settings computer file that in turn points to each SQL Map computer file and contains the data source relationship information.

This guide will focus on using iBatis in a Java application and a heritage MySQL data source. Abator, a code creation tool for creating the information mentioned above, will also be presented, but otherwise, only basic information about Java, XML, and SQL are presumed along with a few common Java tools and collections such as Surpass, Ant and Log4J.

Related Questions