I_Connection Class Reference
[Database Server Interfaces]

Search Toolkit Book for I_Connection

#include <interfaces.hpp>

Inheritance diagram for I_Connection:

Inheritance graph
[legend]
List of all members.

Detailed Description

I_Connection::.

Definition at line 1089 of file interfaces.hpp.

Public Member Functions

 I_Connection (void)
virtual ~I_Connection (void)
CDB_LangCmdLangCmd (const string &lang_query, unsigned int)
CDB_RPCCmdRPC (const string &rpc_name, unsigned int)
CDB_BCPInCmdBCPIn (const string &table_name, unsigned int)
CDB_CursorCmdCursor (const string &cursor_name, const string &query, unsigned int, unsigned int batch_size)

Protected Member Functions

virtual bool IsAlive (void)=0
 Check out if connection is alive.
virtual CDB_LangCmdLangCmd (const string &lang_query)=0
 Language command.
virtual CDB_RPCCmdRPC (const string &rpc_name)=0
 Remote procedure call.
virtual CDB_BCPInCmdBCPIn (const string &table_name)=0
 "Bulk copy in" command
virtual CDB_CursorCmdCursor (const string &cursor_name, const string &query, unsigned int batch_size)=0
 Cursor.
CDB_CursorCmdCursor (const string &cursor_name, const string &query)
virtual CDB_SendDataCmdSendDataCmd (I_ITDescriptor &desc, size_t data_size, bool log_it=true)=0
 Create send-data command.
virtual bool SendData (I_ITDescriptor &desc, CDB_Stream &lob, bool log_it=true)=0
 Shortcut to send text and image to the server without using the "Send-data" command (SendDataCmd).
virtual bool Refresh (void)=0
 Reset the connection to the "ready" state (cancel all active commands).
virtual const string & ServerName (void) const =0
 Get the server name.
virtual const string & UserName (void) const =0
 Get the user user.
virtual const string & Password (void) const =0
 Get the password.
virtual const string & DatabaseName (void) const =0
 Get the database name.
virtual I_DriverContext::TConnectionMode ConnectMode (void) const =0
 Get the bitmask for the connection mode (BCP, secure login, .
virtual bool IsReusable (void) const =0
 Check if this connection is a reusable one.
virtual const string & PoolName (void) const =0
 Find out which connection pool this connection belongs to.
virtual I_DriverContextContext (void) const =0
 Get pointer to the driver context.
virtual void PushMsgHandler (CDB_UserHandler *h, EOwnership ownership=eNoOwnership)=0
 Put the message handler into message handler stack.
virtual void PopMsgHandler (CDB_UserHandler *h)=0
 Remove the message handler (and all above it) from the stack.
virtual CDB_ResultProcessorSetResultProcessor (CDB_ResultProcessor *rp)=0
 Set new result-processor.
virtual bool Abort (void)=0
 Abort the connection.
virtual bool Close (void)=0
 Close an open connection.
virtual void SetTimeout (size_t nof_secs)=0
 Set connection timeout.


Constructor & Destructor Documentation

I_Connection::I_Connection void   ) 
 

Definition at line 325 of file interfaces.cpp.

I_Connection::~I_Connection void   )  [virtual]
 

Definition at line 329 of file interfaces.cpp.


Member Function Documentation

virtual bool I_Connection::Abort void   )  [protected, pure virtual]
 

Abort the connection.

Returns:
TRUE - if succeeded, FALSE if not
Note:
Attention: it is not recommended to use this method unless you absolutely have to. The expected implementation is - close underlying file descriptor[s] without destroing any objects associated with a connection.
See also:
Close

Implemented in CDB_Connection.

CDB_BCPInCmd* I_Connection::BCPIn const string &  table_name,
unsigned  int
[inline]
 

Reimplemented in CDB_Connection.

Definition at line 1312 of file interfaces.hpp.

References BCPIn().

virtual CDB_BCPInCmd* I_Connection::BCPIn const string &  table_name  )  [protected, pure virtual]
 

"Bulk copy in" command

Implemented in CDB_Connection.

Referenced by BCPIn().

virtual bool I_Connection::Close void   )  [protected, pure virtual]
 

Close an open connection.

This method will return connection (if it is created as reusable) to its connection pool

Returns:
TRUE - if succeeded, FALSE if not
See also:
Abort, I_DriverContext::Connect

Implemented in CDB_Connection.

virtual I_DriverContext::TConnectionMode I_Connection::ConnectMode void   )  const [protected, pure virtual]
 

Get the bitmask for the connection mode (BCP, secure login, .

..)

Returns:
bitmask for the connection mode (BCP, secure login, ...)

Implemented in CDB_Connection.

virtual I_DriverContext* I_Connection::Context void   )  const [protected, pure virtual]
 

Get pointer to the driver context.

Returns:
pointer to the driver context

Implemented in CDB_Connection.

CDB_CursorCmd* I_Connection::Cursor const string &  cursor_name,
const string &  query,
unsigned  int,
unsigned int  batch_size
[inline]
 

Reimplemented in CDB_Connection.

Definition at line 1317 of file interfaces.hpp.

References Cursor().

CDB_CursorCmd* I_Connection::Cursor const string &  cursor_name,
const string &  query
[inline, protected]
 

Reimplemented in CDB_Connection.

Definition at line 1124 of file interfaces.hpp.

References Cursor().

virtual CDB_CursorCmd* I_Connection::Cursor const string &  cursor_name,
const string &  query,
unsigned int  batch_size
[protected, pure virtual]
 

Cursor.

Implemented in CDB_Connection.

Referenced by Cursor().

virtual const string& I_Connection::DatabaseName void   )  const [protected, pure virtual]
 

Get the database name.

Returns:
Password value.

Implemented in CDB_Connection.

virtual bool I_Connection::IsAlive void   )  [protected, pure virtual]
 

Check out if connection is alive.

This function doesn't ping the server, it just checks the status of connection which was set by the last i/o operation.

Returns:
  • true if connection is alive
  • false in other case.

Implemented in CDB_Connection.

virtual bool I_Connection::IsReusable void   )  const [protected, pure virtual]
 

Check if this connection is a reusable one.

Returns:
  • true if this connection is a reusable one.

Implemented in CDB_Connection.

CDB_LangCmd* I_Connection::LangCmd const string &  lang_query,
unsigned  int
[inline]
 

Reimplemented in CDB_Connection.

Definition at line 1302 of file interfaces.hpp.

References LangCmd().

virtual CDB_LangCmd* I_Connection::LangCmd const string &  lang_query  )  [protected, pure virtual]
 

Language command.

On error, an exception will be thrown (they never return NULL!). It is the user's responsibility to delete the returned "command" object.

Implemented in CDB_Connection.

Referenced by LangCmd().

virtual const string& I_Connection::Password void   )  const [protected, pure virtual]
 

Get the password.

Returns:
Password value.

Implemented in CDB_Connection.

virtual const string& I_Connection::PoolName void   )  const [protected, pure virtual]
 

Find out which connection pool this connection belongs to.

Returns:
connection pool

Implemented in CDB_Connection.

virtual void I_Connection::PopMsgHandler CDB_UserHandler h  )  [protected, pure virtual]
 

Remove the message handler (and all above it) from the stack.

Parameters:
h Error message handler.
See also:
PushMsgHandler

Implemented in CDB_Connection.

virtual void I_Connection::PushMsgHandler CDB_UserHandler h,
EOwnership  ownership = eNoOwnership
[protected, pure virtual]
 

Put the message handler into message handler stack.

Parameters:
h Error message handler.
ownership If set to eNoOwnership, it is user's responsibility to unregister and delete the error message handler. If set to eTakeOwnership, then DBAPI will take ownership of the error message handler and delete it itself.
See also:
PopMsgHandler

Implemented in CDB_Connection.

virtual bool I_Connection::Refresh void   )  [protected, pure virtual]
 

Reset the connection to the "ready" state (cancel all active commands).

Returns:
  • true on success.

Implemented in CDB_Connection.

CDB_RPCCmd* I_Connection::RPC const string &  rpc_name,
unsigned  int
[inline]
 

Reimplemented in CDB_Connection.

Definition at line 1307 of file interfaces.hpp.

References RPC().

virtual CDB_RPCCmd* I_Connection::RPC const string &  rpc_name  )  [protected, pure virtual]
 

Remote procedure call.

Implemented in CDB_Connection.

Referenced by RPC().

virtual bool I_Connection::SendData I_ITDescriptor desc,
CDB_Stream lob,
bool  log_it = true
[protected, pure virtual]
 

Shortcut to send text and image to the server without using the "Send-data" command (SendDataCmd).

Parameters:
desc Lob descriptor.
lob Text or Image object.
log_it Log LOB operation if this value is set to true.
Returns:
  • true on success.
See also:
SendDataCmd

Implemented in CDB_Connection.

virtual CDB_SendDataCmd* I_Connection::SendDataCmd I_ITDescriptor desc,
size_t  data_size,
bool  log_it = true
[protected, pure virtual]
 

Create send-data command.

Parameters:
desc Lob descriptor.
data_size Maximal data size.
log_it Log LOB operation if this value is set to true.
Returns:
Newly created send-data object.
See also:
SendData

Implemented in CDB_Connection.

virtual const string& I_Connection::ServerName void   )  const [protected, pure virtual]
 

Get the server name.

Returns:
Server/Service name.

Implemented in CDB_Connection.

virtual CDB_ResultProcessor* I_Connection::SetResultProcessor CDB_ResultProcessor rp  )  [protected, pure virtual]
 

Set new result-processor.

Parameters:
rp New result-processor.
Returns:
Old result-processor

Implemented in CDB_Connection.

virtual void I_Connection::SetTimeout size_t  nof_secs  )  [protected, pure virtual]
 

Set connection timeout.

Parameters:
nof_secs Number of seconds. If "nof_secs" is zero or is "too big" (depends on the underlying DB API), then set the timeout to infinite.

Implemented in CDB_Connection.

virtual const string& I_Connection::UserName void   )  const [protected, pure virtual]
 

Get the user user.

Returns:
User name.

Implemented in CDB_Connection.


The documentation for this class was generated from the following files:
Generated on Mon Dec 7 15:30:59 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:24:24 2009 by modify_doxy.py rev. 173732