...
This commit is contained in:
parent
8a7ff68090
commit
99ad1a491d
@ -97,3 +97,60 @@ void ImportCarDealerAchievementToOracle( std::string use
|
|||||||
|
|
||||||
Environment::Cleanup();
|
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 <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "../../Datastructure/CarDealerAchievement/CarDealerAchievement.h"
|
#include "../../Datastructure/CarDealerAchievement/CarDealerAchievement.h"
|
||||||
|
#include "../../Datastructure/RepairOrder/RepairOrder.h"
|
||||||
|
|
||||||
|
|
||||||
void ImportCarDealerAchievementToOracle( std::string userName,
|
void ImportCarDealerAchievementToOracle( std::string userName,
|
||||||
std::string password,
|
std::string password,
|
||||||
std::string tnsName,
|
std::string tnsName,
|
||||||
std::vector<CarDealerAchievement> & achievementVector );
|
std::vector<CarDealerAchievement> & achievementVector );
|
||||||
|
|
||||||
|
void ImportCarDealerAchievementToOracle( std::string userName,
|
||||||
|
std::string password,
|
||||||
|
std::string tnsName,
|
||||||
|
std::vector<RepairOrder> & orderVector )
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user