...
This commit is contained in:
		@@ -97,3 +97,60 @@ void ImportCarDealerAchievementToOracle( std::string                         use
 | 
			
		||||
 | 
			
		||||
	Environment::Cleanup();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ImportCarDealerAchievementToOracle( std::string                userName,
 | 
			
		||||
                                         std::string                password,
 | 
			
		||||
                                         std::string                tnsName,
 | 
			
		||||
                                         std::vector<RepairOrder> & orderVector )
 | 
			
		||||
{
 | 
			
		||||
	ostring sqlImport =
 | 
			
		||||
		"";
 | 
			
		||||
	
 | 
			
		||||
	//初始化
 | 
			
		||||
	try
 | 
			
		||||
	{
 | 
			
		||||
		Environment::Initialize();
 | 
			
		||||
	}
 | 
			
		||||
	catch (exception & error)
 | 
			
		||||
	{
 | 
			
		||||
		string errorMessage = "ocilib初始化失败!";
 | 
			
		||||
		errorMessage.append(error.what());
 | 
			
		||||
 | 
			
		||||
		throw runtime_error(errorMessage);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	Connection* pConn = nullptr;
 | 
			
		||||
	Statement* pStmt = nullptr;
 | 
			
		||||
 | 
			
		||||
	try
 | 
			
		||||
	{
 | 
			
		||||
		pConn = new Connection(userName, password, tnsName);
 | 
			
		||||
	}
 | 
			
		||||
	catch (exception & error)
 | 
			
		||||
	{
 | 
			
		||||
		string errorMessage = "连接oracle失败!";
 | 
			
		||||
		errorMessage.append(error.what());
 | 
			
		||||
 | 
			
		||||
		Environment::Cleanup();
 | 
			
		||||
 | 
			
		||||
		throw runtime_error(errorMessage);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	try
 | 
			
		||||
	{
 | 
			
		||||
		pStmt = new Statement(*pConn);
 | 
			
		||||
 | 
			
		||||
		pStmt->AllowRebinding(true);
 | 
			
		||||
	}
 | 
			
		||||
	catch ( exception & error )
 | 
			
		||||
	{
 | 
			
		||||
		string errorMessage = "语句执行失败!";
 | 
			
		||||
		errorMessage.append(error.what());
 | 
			
		||||
 | 
			
		||||
		Environment::Cleanup();
 | 
			
		||||
 | 
			
		||||
		throw runtime_error(errorMessage);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	Environment::Cleanup();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -3,9 +3,16 @@
 | 
			
		||||
#include <string>
 | 
			
		||||
#include <vector>
 | 
			
		||||
#include "../../Datastructure/CarDealerAchievement/CarDealerAchievement.h"
 | 
			
		||||
#include "../../Datastructure/RepairOrder/RepairOrder.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void ImportCarDealerAchievementToOracle( std::string                         userName,
 | 
			
		||||
                                         std::string                         password,
 | 
			
		||||
                                         std::string                         tnsName,
 | 
			
		||||
                                         std::vector<CarDealerAchievement> & achievementVector );
 | 
			
		||||
 | 
			
		||||
void ImportCarDealerAchievementToOracle( std::string                userName,
 | 
			
		||||
                                                std::string                password,
 | 
			
		||||
                                                std::string                tnsName,
 | 
			
		||||
                                                std::vector<RepairOrder> & orderVector )
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user