sqldata/sqldb.cpp
// Perform static initialization of the API libraries
Perform static initialization of the API libraries
Perform static initialization of the API libraries
int SqlDb::InitStatic(int db_types, const char *source_conn, const char *target_conn, int *s_rc_out, int *t_rc_out)
{
	std::string error_text;
	int s_rc = InitStaticApi(source_conn, error_text);
	if(s_rc == -1)
	{
		_source_ca.cmd_rc = (short)s_rc;
		strcpy(_source_ca.native_error_text, error_text.c_str());
	}
	if(s_rc_out != NULL)
		*s_rc_out = s_rc;
	if(db_types == SQLDB_SOURCE_ONLY)
		return s_rc;
	error_text.clear();
	int t_rc = InitStaticApi(target_conn, error_text);
	if(t_rc == -1)
	{
		_target_ca.cmd_rc = (short)t_rc;
		strcpy(_target_ca.native_error_text, error_text.c_str());
	}
	if(t_rc_out != NULL)
		*t_rc_out = t_rc;
	if(s_rc == -1 || t_rc == -1)
		return -1;
	return 0;
}
int SqlDb :: InitStatic ( int db_types , const char * source_conn , const char * target_conn , int * s_rc_out , int * t_rc_out ) { std :: string error_text ; int s_rc = InitStaticApi ( source_conn , error_text ) ; if ( s_rc == -1 ) { _source_ca . cmd_rc = ( short ) s_rc ; strcpy ( _source_ca . native_error_text , error_text . c_str ( ) ) ; } if ( s_rc_out != NULL ) * s_rc_out = s_rc ; if ( db_types == SQLDB_SOURCE_ONLY ) return s_rc ; error_text . clear ( ) ; int t_rc = InitStaticApi ( target_conn , error_text ) ; if ( t_rc == -1 ) { _target_ca . cmd_rc = ( short ) t_rc ; strcpy ( _target_ca . native_error_text , error_text . c_str ( ) ) ; } if ( t_rc_out != NULL ) * t_rc_out = t_rc ; if ( s_rc == -1 || t_rc == -1 ) return -1 ; return 0 ; }
Perform static initialization of the API libraries
Perform static initialization of the API libraries
// Source database is only initialized