sqldata/sqldatacmd.cpp
// Connect to the database to read metadata
Connect to the database to read metadata
Connect to the database to read metadata
int SqlDataCmd::Connect()
{
	SqlDataReply reply;
	int rc = -1;
	if(_command == SQLDATA_CMD_TRANSFER || _command == SQLDATA_CMD_TRANSFER_OBJ || _command == SQLDATA_CMD_VALIDATE)
	{
		_log.Log("\n\nConnecting to databases");
		rc = _sqlData.ConnectMetaDb(reply, SQLDB_BOTH);
	}
	else
	if(_command == SQLDATA_CMD_ASSESS)
	{
		_log.Log("\n\nConnecting to database");
		rc = _sqlData.ConnectMetaDb(reply, SQLDB_SOURCE_ONLY);
	}
	char time_fmt[21];
	Str::FormatTime(reply._time_spent, time_fmt);
	_log.Log(" (%s)\n  ", time_fmt);
	LogConnection(_source_type, reply._s_rc, reply._s_name, reply.s_native_error_text, reply._s_time_spent);
	if(_command != SQLDATA_CMD_ASSESS)
	{
		_log.Log("\n  ");
		LogConnection(_target_type, reply._t_rc, reply._t_name, reply.t_native_error_text, reply._t_time_spent);
	}
	return rc;
}
int SqlDataCmd :: Connect ( ) { SqlDataReply reply ; int rc = -1 ; if ( _command == SQLDATA_CMD_TRANSFER || _command == SQLDATA_CMD_TRANSFER_OBJ || _command == SQLDATA_CMD_VALIDATE ) { _log . Log ( " \n \n " ) ; rc = _sqlData . ConnectMetaDb ( reply , SQLDB_BOTH ) ; } else if ( _command == SQLDATA_CMD_ASSESS ) { _log . Log ( " \n \n " ) ; rc = _sqlData . ConnectMetaDb ( reply , SQLDB_SOURCE_ONLY ) ; } char time_fmt [ 21 ] ; Str :: FormatTime ( reply . _time_spent , time_fmt ) ; _log . Log ( " \n " , time_fmt ) ; LogConnection ( _source_type , reply . _s_rc , reply . _s_name , reply . s_native_error_text , reply . _s_time_spent ) ; if ( _command != SQLDATA_CMD_ASSESS ) { _log . Log ( " \n " ) ; LogConnection ( _target_type , reply . _t_rc , reply . _t_name , reply . t_native_error_text , reply . _t_time_spent ) ; } return rc ; }
Connect to the database to read metadata
Connect to the database to read metadata
// Connect to databases to read metadata // In assessment mode connect to the source database only // Connect to databases to read metadata