|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sage.orion.sdata.servlet.swtservice.tablebuilder.JDBCTableBuilder
public class JDBCTableBuilder
JDBCTableBuilder provides implementation of the DBTableBuilder interface. It includes a set of service functions to create table, add keys, indices. It also populates the table with data from the xml file or a DOM document.
Field Summary | |
---|---|
static java.lang.String |
RECORD_TAG
Record tag |
static java.lang.String |
RECORDS_TAG
Records tag |
Constructor Summary | |
---|---|
JDBCTableBuilder(JDBCDatabaseType databaseType)
Constructor |
Method Summary | |
---|---|
void |
addField(java.lang.String name,
FieldDataType fieldDataType,
int length,
boolean allownull,
java.lang.String identity,
java.lang.String identityStart,
java.lang.String identityIncrement)
Adds field to the collection |
void |
addFields(java.util.Collection<FieldDefinition> fields)
Adds fields to table |
void |
addIndex(java.lang.String index,
java.lang.String name)
Adds index to map |
void |
addIndices(java.util.Collection<IndexDefinition> indices)
Adds indices to table |
void |
addKey(java.lang.String key,
boolean isPrimaryKey)
Sets primary key |
void |
addRecordsFromDOMDocument(org.w3c.dom.Document document)
Insert the records into the table from an XML document of suitable format. |
void |
addRecordsFromXml(java.lang.String xmlFileName)
Reads records from xml file and adds them to table |
void |
buildTable(java.sql.Connection connection,
java.lang.String name,
boolean createTableIfNotExists)
Creates table |
void |
closePortalPreparedStatements(java.lang.String tableName)
Closes the PreparedStatement s for populating the portal
database. |
java.sql.ResultSet |
getResultSetFromQuery(java.sql.Statement statement,
java.lang.String query)
get the resultset object from the given Statement and query string. |
boolean |
isTableExist(java.sql.Connection connection,
java.lang.String tableName)
Check for the given table is exist or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String RECORD_TAG
public static final java.lang.String RECORDS_TAG
Constructor Detail |
---|
public JDBCTableBuilder(JDBCDatabaseType databaseType)
databaseType
- the underlying databaseType.Method Detail |
---|
public void addField(java.lang.String name, FieldDataType fieldDataType, int length, boolean allownull, java.lang.String identity, java.lang.String identityStart, java.lang.String identityIncrement)
addField
in interface DBTableBuilder
name
- - The name of the fieldfieldDataType
- - The database-agnostic data type of the fieldlength
- - The length of the fieldallownull
- - The allownull attribute of the fieldidentity
- - The identity of the auto-incremental fieldidentityStart
- - The Start of the auto-incremental fieldidentityIncrement
- - The Increment of the auto-incremental fieldpublic void addFields(java.util.Collection<FieldDefinition> fields)
addFields
in interface DBTableBuilder
fields
- - collection of field definitionspublic void addKey(java.lang.String key, boolean isPrimaryKey)
key
- - key nameisPrimaryKey
- - primary or foreign key flagpublic void addIndex(java.lang.String index, java.lang.String name)
addIndex
in interface DBTableBuilder
index
- - Index identifiername
- - The name argument of the indexpublic void addIndices(java.util.Collection<IndexDefinition> indices)
addIndices
in interface DBTableBuilder
indices
- - collection of index definitionspublic void addRecordsFromDOMDocument(org.w3c.dom.Document document)
document
- records as a XML documentpublic void addRecordsFromXml(java.lang.String xmlFileName)
addRecordsFromXml
in interface DBTableBuilder
xmlFileName
- - full path/name of the xml filepublic void buildTable(java.sql.Connection connection, java.lang.String name, boolean createTableIfNotExists)
connection
- - connection to the tablename
- - table namecreateTableIfNotExists
- flagpublic boolean isTableExist(java.sql.Connection connection, java.lang.String tableName)
connection
- Connection to connect database tablestableName
- String having table name.
public java.sql.ResultSet getResultSetFromQuery(java.sql.Statement statement, java.lang.String query) throws java.sql.SQLException
statement
- statementquery
- query
java.sql.SQLException
- exceptionpublic void closePortalPreparedStatements(java.lang.String tableName)
PreparedStatement
s for populating the portal
database.
tableName
- The portal table name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |