1 #ifndef _WX_DATABASE_TDS_DATABASE_H_ 2 #define _WX_DATABASE_TDS_DATABASE_H_ 16 wxTdsDatabase(
const wxString& strFreeTDS,
const wxString& strServer,
const wxString& strDatabase,
const wxString& strUser,
const wxString& strPassword,
int nTdsVersion = TDS_80);
22 virtual bool Open(
const wxString& strDatabase);
38 virtual int RunQuery(
const wxString& strQuery,
bool bParseQuery);
44 void SetFreeTDS(
const wxString& strFreeTDS) { m_strFreeTDS = strFreeTDS; }
45 void SetServer(
const wxString& strServer) { m_strServer = strServer; }
46 void SetDatabase(
const wxString& strDatabase) { m_strDatabase = strDatabase; }
47 void SetLogin(
const wxString& strLogin) { m_strLogin = strLogin; }
48 void SetPassword(
const wxString& strPassword) { m_strPassword = strPassword; }
71 virtual wxArrayString
GetColumns(
const wxString& table);
72 virtual wxArrayString
GetPKColumns(
const wxString& table);
74 static wxTdsDatabase* LookupTdsLayer(
const TDSCONTEXT* pContext);
75 void SetError(
int nCode,
const wxString& strMessage);
85 static int TranslateErrorCode(
int nCode);
86 void FreeAllocatedResultSets(
status_t* status = NULL);
87 static void AddTdsLayer(TDSCONTEXT* pContext,
wxTdsDatabase* pLayer);
88 static void RemoveTdsLayer(TDSCONTEXT* pContext);
90 TDSPARAMINFO* GetParameters(
const wxString& strQuery);
107 #endif//_WX_DATABASE_TDS_DATABASE_H_ virtual wxArrayString GetPKColumns(const wxString &table)=0
get Primary keys column names
virtual wxArrayString GetViews()=0
Retrieve all view names.
WX_DECLARE_HASH_MAP(TDSCONTEXT *, wxTdsDatabase *, wxPointerHash, wxPointerEqual, TdsContextToDatabaseLayerMap)
void SetServer(const wxString &strServer)
virtual wxPreparedStatement * PrepareStatement(const wxString &strQuery)=0
Prepare a SQL statement which can be reused with different parameters.
void SetFreeTDS(const wxString &strFreeTDS)
virtual void RollBack()=0
Rollback the current transaction.
void SetDatabase(const wxString &strDatabase)
virtual bool IsOpen()=0
Is the connection to the database open?
void SetTdsVersion(int nTdsVersion)
virtual int RunQuery(const wxString &strQuery)
Run an insert, update, or delete query on the database.
virtual void BeginTransaction()=0
Begin a transaction.
virtual bool Open(const wxString &strDatabase)=0
virtual bool ViewExists(const wxString &view)=0
Check for the existence of a view by name.
static TdsContextToDatabaseLayerMap m_ContextLookupMap
virtual void Commit()=0
Commit the current transaction.
virtual wxArrayString GetColumns(const wxString &table)=0
Retrieve all column names for a table.
void SetLogin(const wxString &strLogin)
virtual bool Close()=0
close database
virtual bool TableExists(const wxString &table)=0
Check for the existence of a table by name.
#define WXDLLIMPEXP_DATABASE
void SetPassword(const wxString &strPassword)
virtual wxArrayString GetTables()=0
Retrieve all table names.
virtual wxDatabaseResultSet * RunQueryWithResults(const wxString &strQuery)=0
Run a select query on the database.