Class fr.bizolin.xml.sql.SQL2XML
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class fr.bizolin.xml.sql.SQL2XML

java.lang.Object
   |
   +----fr.bizolin.xml.sql.SQL2XML

public class SQL2XML
extends Object
SQL2XML by Bizolin (c)Cyril Vincent
www.multimania.com/cvincent/
March 2000
Perform a SQL query and return the result in a XML file
With this class you don't hava to change your information system if you want to use XML.

The output DTD :
<!ELEMENT query (line)*>
<!ATTLIST query statement CDATA #IMPLIED dbname CDATA #IMPLIED jdbcurl CDATA #IMPLIED>
<!ELEMENT line (column)*>
<!ATTLIST line linenumber CDATA #REQUIRED >
<!ELEMENT column (#PCDATA )>
<!ATTLIST column columnname CDATA #REQUIRED columnreadonly (false|true) #REQUIRED columntype CDATA #REQUIRED>

Output sample :
<?xml version="1.0" encoding="ISO-8859-1"?>
<query dbname="sc" jdbcurl="jdbc:odbc:SellingChain" statement="select * from toto">
<line linenumber="0">
<column columnname="titi" columnreadonly="false" columntype="VARCHAR">Hello</column>
</line>

This class needs the org.w3c.dom and oracle.xml.parser.v2 packages.

Version:
0.1.000315
Author:
Cyril Vincent

Constructor Index

 o SQL2XML(PreparedStatement, String)
Perform a query and return the result in a XML file
 o SQL2XML(String, String, String, String)
Perform a query and return the result in a XML file
 o SQL2XML(String, String, String, String, String, String)
Perform a query and return the result in a XML file

Method Index

 o createDocument(ResultSet, String, String, String)
Create a DOM XML document
 o main(String[])
Main program

Constructors

 o SQL2XML
 public SQL2XML(String driver,
                String url,
                String login,
                String password,
                String encoding,
                String query)
Perform a query and return the result in a XML file

Parameters:
driver - JDBC Driver
url - JDBC URL
login - Database login
password - Database password
encoding - XML encoding
query - SQL query
 o SQL2XML
 public SQL2XML(String url,
                String login,
                String password,
                String query)
Perform a query and return the result in a XML file

Parameters:
url - JDBC URL
login - Database login
password - Database password
query - SQL query
 o SQL2XML
 public SQL2XML(PreparedStatement ps,
                String query)
Perform a query and return the result in a XML file

Parameters:
ps - Prepared statement
query - SQL query

Methods

 o main
 public static void main(String argv[])
Main program

Parameters:
argv - Input arguments.
 o createDocument
 public Document createDocument(ResultSet rs,
                                String url,
                                String login,
                                String statement)
Create a DOM XML document

Parameters:
rs - Result set
Returns:
DOM Document

All Packages  Class Hierarchy  This Package  Previous  Next  Index