com.dhtmlx.connector
Class DBDataWrapper

java.lang.Object
  extended by com.dhtmlx.connector.DataWrapper
      extended by com.dhtmlx.connector.DBDataWrapper
Direct Known Subclasses:
ArrayDBDataWrapper, MSSQLDBDataWrapper, MySQLDBDataWrapper, OracleDBDataWrapper, PGSQLDBDataWrapper

public abstract class DBDataWrapper
extends DataWrapper

The Class DBDataWrapper. Class implements DataWrapper for common DB type


Constructor Summary
DBDataWrapper()
           
 
Method Summary
 void attach(OperationType name, java.lang.String sql)
          Attach.
 void begin_transaction()
          Begin transaction.
 void commit_transaction()
          Commit transaction.
 void delete(DataAction data, DataRequest source)
          Delete data from storage
abstract  java.lang.String escape(java.lang.String data)
          Escape the data, befor using in SQL
abstract  java.lang.String get_new_id(ConnectorResultSet result)
          Gets the new id
 java.lang.String get_size(DataRequest source)
          Gets the size of the data in storage.
 java.lang.String get_sql(OperationType name, java.util.HashMap<java.lang.String,java.lang.String> data)
          Gets the sql string for named operation
 ConnectorResultSet get_variants(DataRequest source, java.lang.String field)
          Gets the all variations of defined field in the storage
 void insert(DataAction data, DataRequest source)
          Insert data in storage
 ConnectorResultSet query(java.lang.String data)
          Executes DB query.
 void rollback_transaction()
          Rollback transaction.
 ConnectorResultSet select(DataRequest source)
          Select data from storage
 void sequence(java.lang.String sequence_name)
          Sets sequence Sequence used in Oracle to implement auto-id generation
 void update(DataAction data, DataRequest source)
          Update data in storage
 
Methods inherited from class com.dhtmlx.connector.DataWrapper
init, is_global_transaction, is_record_transaction, set_transaction_mode
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBDataWrapper

public DBDataWrapper()
Method Detail

escape

public abstract java.lang.String escape(java.lang.String data)
Escape the data, befor using in SQL

Parameters:
data - the incoming data
Returns:
the escaped string

get_new_id

public abstract java.lang.String get_new_id(ConnectorResultSet result)
                                     throws ConnectorOperationException
Gets the new id

Parameters:
result - the resultset, which contains the new ID
Returns:
the new id value
Throws:
ConnectorOperationException - the connector operation exception

sequence

public void sequence(java.lang.String sequence_name)
Sets sequence Sequence used in Oracle to implement auto-id generation

Parameters:
sequence_name - the name of sequence

attach

public void attach(OperationType name,
                   java.lang.String sql)
Attach.

Parameters:
name - the name
sql - the sql

get_sql

public java.lang.String get_sql(OperationType name,
                                java.util.HashMap<java.lang.String,java.lang.String> data)
                         throws ConnectorConfigException
Description copied from class: DataWrapper
Gets the sql string for named operation

Overrides:
get_sql in class DataWrapper
Parameters:
name - the name of operation
data - the hash of data, will be used to fill vars in sql
Returns:
the sql string
Throws:
ConnectorConfigException - the connector config exception

delete

public void delete(DataAction data,
                   DataRequest source)
            throws ConnectorOperationException
Description copied from class: DataWrapper
Delete data from storage

Specified by:
delete in class DataWrapper
Parameters:
data - the data wrapped in DataAction object
source - the source defined by DataRequest object
Throws:
ConnectorOperationException - the connector operation exception

get_size

public java.lang.String get_size(DataRequest source)
                          throws ConnectorOperationException
Description copied from class: DataWrapper
Gets the size of the data in storage.

Specified by:
get_size in class DataWrapper
Parameters:
source - the source defined by DataRequest object
Returns:
the size of collection in storage
Throws:
ConnectorOperationException - the connector operation exception

get_variants

public ConnectorResultSet get_variants(DataRequest source,
                                       java.lang.String field)
                                throws ConnectorOperationException
Description copied from class: DataWrapper
Gets the all variations of defined field in the storage

Specified by:
get_variants in class DataWrapper
Parameters:
source - the source defined by DataRequest object
Returns:
the set of variations
Throws:
ConnectorOperationException - the connector operation exception

insert

public void insert(DataAction data,
                   DataRequest source)
            throws ConnectorOperationException
Description copied from class: DataWrapper
Insert data in storage

Specified by:
insert in class DataWrapper
Parameters:
data - the data wrapped in DataAction object
source - the source defined by DataRequest object
Throws:
ConnectorOperationException - the connector operation exception

select

public ConnectorResultSet select(DataRequest source)
                          throws ConnectorOperationException
Description copied from class: DataWrapper
Select data from storage

Specified by:
select in class DataWrapper
Parameters:
source - the source defined by DataRequest object
Returns:
the connector result set
Throws:
ConnectorOperationException - the connector operation exception

update

public void update(DataAction data,
                   DataRequest source)
            throws ConnectorOperationException
Description copied from class: DataWrapper
Update data in storage

Specified by:
update in class DataWrapper
Parameters:
data - the data wrapped in DataAction object
source - the source defined by DataRequest object
Throws:
ConnectorOperationException - the connector operation exception

begin_transaction

public void begin_transaction()
                       throws ConnectorOperationException
Description copied from class: DataWrapper
Begin transaction.

Overrides:
begin_transaction in class DataWrapper
Throws:
ConnectorOperationException - the connector operation exception

commit_transaction

public void commit_transaction()
                        throws ConnectorOperationException
Description copied from class: DataWrapper
Commit transaction.

Overrides:
commit_transaction in class DataWrapper
Throws:
ConnectorOperationException - the connector operation exception

rollback_transaction

public void rollback_transaction()
                          throws ConnectorOperationException
Description copied from class: DataWrapper
Rollback transaction.

Overrides:
rollback_transaction in class DataWrapper
Throws:
ConnectorOperationException - the connector operation exception

query

public ConnectorResultSet query(java.lang.String data)
                         throws ConnectorOperationException
Executes DB query.

Parameters:
data - the data
Returns:
the connector result set
Throws:
ConnectorOperationException - the connector operation exception