xmlBlaster 2.2.0 contributions API

org.xmlBlaster.contrib.dbwriter.info
Class SqlInfo

java.lang.Object
  extended by org.xmlBlaster.contrib.dbwriter.info.SqlInfo
All Implemented Interfaces:
ContribConstants, ReplicationConstants

public class SqlInfo
extends java.lang.Object
implements ReplicationConstants


Field Summary
static java.lang.String SQL_TAG
           
 
Fields inherited from interface org.xmlBlaster.contrib.replication.ReplicationConstants
ABSOLUTE_COUNT, ACTION_ATTR, ALREADY_PROCESSED_ATTR, ALTER_ACTION, CATALOG_ATTR, CONTRIB_PERSISTENT_MAP, CREATE_ACTION, DB_ID_ATTR, DELETE_ACTION, DROP_ACTION, DUMP_ACTION, DUMP_CONTENT_ATTR, DUMP_FILENAME, DUMP_POSTFIX, END_OF_TRANSITION, EXCEPTION_ATTR, EXTRA_REPL_KEY_ATTR, GUID_ATTR, INITIAL_DATA_END, INITIAL_DATA_END_TO_REMOTE, INITIAL_DATA_ID, INITIAL_DUMP_AS_XML, INITIAL_FILES_LOCATION, INITIAL_UPDATE_COLLECT, INITIAL_UPDATE_ONLY_REGISTER, INITIAL_UPDATE_START_BATCH, INITIAL_XML_CMD, INSERT_ACTION, KEEP_TRANSACTION_OPEN, MASTER_ATTR, MAX_ENTRIES_ATTR, MESSAGE_SEQ, NUM_OF_TRANSACTIONS, OLD_CONTENT_ATTR, PURPOSE_REPLICATION, REPL_KEY_ATTR, REPL_MANAGER_SESSION, REPL_MANAGER_TOPIC, REPL_PREFIX_DEFAULT, REPL_PREFIX_GROUP_KEY, REPL_PREFIX_KEY, REPL_REQUEST_CANCEL_UPDATE, REPL_REQUEST_RECREATE_TRIGGERS, REPL_REQUEST_UPDATE, REPL_VERSION, REPLICATION_CMD, REPLICATION_FORCE_SENDING, REPLICATION_MAX_ENTRIES_DEFAULT, REPLICATION_MAX_ENTRIES_KEY, REPLICATION_SEND_UNCHANGED_UPDATES, REPLICATION_VERSION, REQUEST_BROADCAST_SQL_TOPIC, REQUEST_CANCEL_UPDATE_TOPIC, REQUEST_INITIAL_DATA_TOPIC, REQUEST_RECREATE_TRIGGERS, RESPONSE_INITIAL_DATA_TOPIC, SCHEMA_ATTR, SIMPLE_MESSAGE, SLAVE_NAME, SQL_TOPIC_ATTR, STATEMENT_ACTION, STATEMENT_ATTR, STATEMENT_ID_ATTR, STATEMENT_PRIO_ATTR, SUPPORTED_VERSIONS, TABLE_NAME_ATTR, TRANSACTION_ATTR, TRANSACTION_SEQ, UPDATE_ACTION, VERSION_ATTR, VERSION_TOKEN
 
Fields inherited from interface org.xmlBlaster.contrib.ContribConstants
FILE_DATE, FILENAME_ATTR, FILENAME_ATTR_OLD_FASHION, SUBDIR_ATTR, TIMESTAMP_ATTR, TOPIC_NAME
 
Constructor Summary
SqlInfo(I_Info info)
           
 
Method Summary
static org.xmlBlaster.util.qos.ClientProperty buildClientProperty(java.sql.ResultSetMetaData meta, java.sql.ResultSet rs, int pos)
          Never returns null.
 void fillFromTableSelectDELETED(java.sql.ResultSet rs, boolean fillData, I_AttributeTransformer transformer)
          Deprecated.  
 boolean fillMetadata(java.sql.Connection conn, java.lang.String catalog, java.lang.String schema, java.lang.String table, java.sql.ResultSet queryRs)
           
 boolean fillMetadata(java.sql.Connection conn, java.lang.String catalog, java.lang.String schema, java.lang.String table, java.sql.ResultSet queryRs, I_AttributeTransformer transformer)
          Fills the object with the metadata.
 SqlRow fillOneRow(java.sql.ResultSet rs, java.lang.String rawContent, I_AttributeTransformer transformer)
          Result set must come from a select spaning over a single table.
 SqlRow fillOneRowWithObjects(java.sql.ResultSet rs, I_AttributeTransformer transformer)
          Result set must come from a select spaning over a single table.
 SqlRow fillOneRowWithRandomData()
          This method is used for testing other applications, it generates a new row and adds it if possible.
 SqlRow fillOneRowWithStringEntriesDEPRECATED(java.sql.ResultSet rs, I_AttributeTransformer transformer)
          Result set must come from a select spaning over a single table.
 SqlDescription getDescription()
           
 int getRowCount()
           
 java.util.List getRows()
           
static SqlInfo getStructure(I_Info info)
           
static void main(java.lang.String[] args)
           
 void setDescription(SqlDescription description)
           
 java.lang.String toString()
           
 java.lang.String toXml(java.lang.String extraOffset)
           
 java.lang.String toXml(java.lang.String extraOffset, boolean doTruncate, boolean forceReadable, boolean omitDecl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SQL_TAG

public static final java.lang.String SQL_TAG
See Also:
Constant Field Values
Constructor Detail

SqlInfo

public SqlInfo(I_Info info)
Method Detail

fillMetadata

public boolean fillMetadata(java.sql.Connection conn,
                            java.lang.String catalog,
                            java.lang.String schema,
                            java.lang.String table,
                            java.sql.ResultSet queryRs)
                     throws java.lang.Exception
Throws:
java.lang.Exception

fillMetadata

public boolean fillMetadata(java.sql.Connection conn,
                            java.lang.String catalog,
                            java.lang.String schema,
                            java.lang.String table,
                            java.sql.ResultSet queryRs,
                            I_AttributeTransformer transformer)
                     throws java.lang.Exception
Fills the object with the metadata. By Oracle it seems that the colName is not returned (returns null). In such a case the method returns false. If the table has not been found on the database, a false is returned, true otherwise.

Parameters:
conn -
catalog -
schema -
table -
queryRs -
transformer -
Returns:
true if the entry has been found on the database, false otherwise
Throws:
java.lang.Exception

fillFromTableSelectDELETED

public void fillFromTableSelectDELETED(java.sql.ResultSet rs,
                                       boolean fillData,
                                       I_AttributeTransformer transformer)
                                throws java.lang.Exception
Deprecated. 

Result set must come from a select spaning over a single table.

Parameters:
rs -
conn -
Throws:
java.sql.SQLException
java.lang.Exception

getRowCount

public final int getRowCount()

fillOneRowWithStringEntriesDEPRECATED

public SqlRow fillOneRowWithStringEntriesDEPRECATED(java.sql.ResultSet rs,
                                                    I_AttributeTransformer transformer)
                                             throws java.lang.Exception
Result set must come from a select spaning over a single table.

Parameters:
rs -
conn -
Throws:
java.sql.SQLException
java.lang.Exception

buildClientProperty

public static org.xmlBlaster.util.qos.ClientProperty buildClientProperty(java.sql.ResultSetMetaData meta,
                                                                         java.sql.ResultSet rs,
                                                                         int pos)
                                                                  throws java.lang.Exception
Never returns null. If the result is null, the value of the returned client property will be null.

Parameters:
name -
val -
Returns:
Throws:
java.lang.Exception

fillOneRowWithObjects

public SqlRow fillOneRowWithObjects(java.sql.ResultSet rs,
                                    I_AttributeTransformer transformer)
                             throws java.lang.Exception
Result set must come from a select spaning over a single table.

Parameters:
rs -
conn -
Throws:
java.sql.SQLException
java.lang.Exception

fillOneRow

public SqlRow fillOneRow(java.sql.ResultSet rs,
                         java.lang.String rawContent,
                         I_AttributeTransformer transformer)
                  throws java.lang.Exception
Result set must come from a select spaning over a single table.

Parameters:
rawContent - the raw content of all the columns belonging to this row.
conn -
Throws:
java.sql.SQLException
java.lang.Exception

fillOneRowWithRandomData

public SqlRow fillOneRowWithRandomData()
                                throws java.lang.Exception
This method is used for testing other applications, it generates a new row and adds it if possible. Note that this is only added if it is possible, otherwise it returns null. It is currently not possible to add something if the table in question has a foreign key. No check is made against primary keys.

Throws:
java.sql.SQLException
java.lang.Exception

getDescription

public SqlDescription getDescription()

setDescription

public void setDescription(SqlDescription description)

getRows

public java.util.List getRows()

toXml

public java.lang.String toXml(java.lang.String extraOffset)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toXml

public final java.lang.String toXml(java.lang.String extraOffset,
                                    boolean doTruncate,
                                    boolean forceReadable,
                                    boolean omitDecl)

getStructure

public static SqlInfo getStructure(I_Info info)
                            throws java.lang.Exception
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)

xmlBlaster 2.2.0 contributions API

Copyright © 1999-2014 The xmlBlaster.org contributers.