|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.webdocwf.util.xml.XmlWriter
public class XmlWriter
Load existing XML file , creating DOM from file or creating new DOM.Class has methods for insert,update,delete data from XML file and save new DOM in XML file.
Field Summary | |
---|---|
static SearchElement |
searchDocumentStatic
Document made from XML file, and in which will be made changes.Document will be saved in XML file. |
Constructor Summary | |
---|---|
XmlWriter(java.lang.String fileName,
boolean isAutoCommit)
Constructor used when autoCommit is set to false or true. |
Method Summary | |
---|---|
static void |
commit(java.lang.String fileName)
Method is used for saving DOM in xml file from connection object,when XmlConnection.commit() method is called. |
protected void |
createDatabase()
Method is called when create new database file. |
protected void |
createTable(java.lang.String sqlStatement,
java.lang.String tableName)
Adds sql statement CREATE TABLE in XML file. |
protected void |
delete(java.lang.String tableName,
java.lang.String[] whereColumnNames,
java.lang.String[] whereColumnValues)
Delete row(s) from XML file. |
protected void |
dropTable(java.lang.String tableName)
Delete table from XML file. |
java.util.ArrayList |
getTableProperties(java.lang.String tableName)
Gets table properties in form ArrayList. |
protected void |
insert(java.lang.String tableName,
java.lang.String[] columnNames,
java.lang.String[] columnValues)
Insert row in XML file. |
protected void |
saveDOM()
Save DOM as XML file. |
protected void |
update(java.lang.String tableName,
java.lang.String[] columnNames,
java.lang.String[] columnValues,
java.lang.String[] whereColumnNames,
java.lang.String[] whereColumnValues)
Update row in in XML file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static SearchElement searchDocumentStatic
Constructor Detail |
---|
public XmlWriter(java.lang.String fileName, boolean isAutoCommit) throws java.sql.SQLException
fileName
- name of xml file.isAutoCommit
- define is mod auto commit or not.
java.sql.SQLException
Method Detail |
---|
protected void createTable(java.lang.String sqlStatement, java.lang.String tableName) throws java.sql.SQLException
sqlStatement
- CREATE TABLE statement which will be add into XML filetableName
- name of table which will be created
java.sql.SQLException
protected void delete(java.lang.String tableName, java.lang.String[] whereColumnNames, java.lang.String[] whereColumnValues) throws java.sql.SQLException
tableName
- name of table from which will be deleted rows.whereColumnNames
- names of columns in WHERE clause.whereColumnValues
- values of columns in WHERE clause.
java.sql.SQLException
protected void dropTable(java.lang.String tableName) throws java.sql.SQLException
tableName
- name of table which will be deleted.
java.sql.SQLException
protected void insert(java.lang.String tableName, java.lang.String[] columnNames, java.lang.String[] columnValues) throws java.sql.SQLException
tableName
- name of table in which will be added rows.columnNames
- names of columns in which will be added data.columnValues
- value which will be insert into table.
java.sql.SQLException
protected void update(java.lang.String tableName, java.lang.String[] columnNames, java.lang.String[] columnValues, java.lang.String[] whereColumnNames, java.lang.String[] whereColumnValues) throws java.sql.SQLException
tableName
- name of table which will be updatad.columnNames
- names of columns in which will be added data.columnValues
- value which will be insert into table.whereColumnNames
- names of columns in WHERE clause.whereColumnValues
- values of columns in WHERE clause.
java.sql.SQLException
public java.util.ArrayList getTableProperties(java.lang.String tableName) throws java.sql.SQLException
tableName
- name of table.
java.sql.SQLException
protected void createDatabase() throws java.sql.SQLException
java.sql.SQLException
protected void saveDOM() throws java.sql.SQLException
java.sql.SQLException
public static void commit(java.lang.String fileName) throws java.sql.SQLException
fileName
- full path of xml file.
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |