|
// PhysicalNonFactoryClient.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include "Database.h"
#include "Oracle.h"
#include "SQLServer.h"
#include "Sybase.h"
#pragma comment (lib, "PhysicalNonFactory.lib");
int _tmain(int argc, _TCHAR* argv[])
{
int choice = 0;
do
{
std::cout << "Enter choice" << std::endl;
std::cout << "1. Oracle" << std::endl;
std::cout << "2. SQL Server" << std::endl;
std::cout << "3. Sybase" << std::endl;
std::cin >> choice;
} while (choice < 1 || choice > 3);
Database* pDataBase = NULL;
switch (choice)
{
case 1:
pDataBase = new Oracle();
break;
case 2:
pDataBase = new SQLServer();
break;
case 3:
pDataBase = new Sybase();
break;
}
if (pDataBase != NULL)
{
pDataBase->OpenConnection("This is connection string");
pDataBase->ExecuteCommand("This is command");
pDataBase->CloseConnection();
delete pDataBase;
}
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.