Add support for Virtuoso

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7308 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Bart A.M. Jourquin
2000-04-28 13:45:52 +00:00
parent 89ee194efd
commit 9de1150e2d
3 changed files with 25 additions and 12 deletions

View File

@@ -341,7 +341,8 @@ enum wxDBMS
dbmsPOSTGRES, dbmsPOSTGRES,
dbmsACCESS, dbmsACCESS,
dbmsDBASE, dbmsDBASE,
dbmsINFORMIX dbmsINFORMIX,
dbmsVIRTUOSO
}; };

View File

@@ -68,6 +68,7 @@
#include "wx/wxchar.h" #include "wx/wxchar.h"
#endif #endif
#if wxMAJOR_VERSION == 1 #if wxMAJOR_VERSION == 1
# if defined(wx_msw) || defined(wx_x) # if defined(wx_msw) || defined(wx_x)
# ifdef WX_PRECOMP # ifdef WX_PRECOMP
@@ -840,11 +841,11 @@ bool wxDb::getDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo)
if (!wxStrcmp(structSQLTypeInfo.TypeName, "varchar")) wxStrcpy(structSQLTypeInfo.TypeName, "char"); if (!wxStrcmp(structSQLTypeInfo.TypeName, "varchar")) wxStrcpy(structSQLTypeInfo.TypeName, "char");
} }
// BJO 20000427 : OpenLink driver // BJO 20000427 : OpenLink driver
if (!wxStrncmp(dbInf.driverName, "oplodbc", 7) || if (!wxStrncmp(dbInf.driverName, "oplodbc", 7) ||
!wxStrncmp(dbInf.driverName, "OLOD", 4)) !wxStrncmp(dbInf.driverName, "OLOD", 4))
if (!wxStrcmp(structSQLTypeInfo.TypeName, "double precision")) wxStrcpy(structSQLTypeInfo.TypeName, "real"); if (!wxStrcmp(structSQLTypeInfo.TypeName, "double precision")) wxStrcpy(structSQLTypeInfo.TypeName, "real");
if (SQLGetData(hstmt, 3, SQL_C_LONG, (UCHAR*) &structSQLTypeInfo.Precision, 0, &cbRet) != SQL_SUCCESS) if (SQLGetData(hstmt, 3, SQL_C_LONG, (UCHAR*) &structSQLTypeInfo.Precision, 0, &cbRet) != SQL_SUCCESS)
return(DispAllErrors(henv, hdbc, hstmt)); return(DispAllErrors(henv, hdbc, hstmt));
@@ -1865,8 +1866,14 @@ wxDbColInf *wxDb::GetColumns(char *tableName, int *numCols, const char *userID)
colInf[colNo].FkCol = 0; // Foreign key column 0=No; 1= First Key, 2 = Second Key etc. colInf[colNo].FkCol = 0; // Foreign key column 0=No; 1= First Key, 2 = Second Key etc.
colInf[colNo].FkTableName[0] = 0; // Foreign key table name colInf[colNo].FkTableName[0] = 0; // Foreign key table name
// BJO 20000428 : Virtuoso returns type names with upper cases!
if (Dbms() == dbmsVIRTUOSO)
{
wxString s = colInf[colNo].typeName;
s = s.MakeLower();
wxStrcmp(colInf[colNo].typeName, s.c_str());
}
// Determine the wxDb data type that is used to represent the native data type of this data source // Determine the wxDb data type that is used to represent the native data type of this data source
colInf[colNo].dbDataType = 0; colInf[colNo].dbDataType = 0;
if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName)) if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
@@ -2486,19 +2493,23 @@ wxDBMS wxDb::Dbms(void)
wxChar baseName[25+1]; wxChar baseName[25+1];
wxStrncpy(baseName,dbInf.dbmsName,25); wxStrncpy(baseName,dbInf.dbmsName,25);
// BJO 20000428 : add support for Virtuoso
if (!wxStricmp(dbInf.dbmsName,"OpenLink Virtuoso VDBMS"))
return(dbmsVIRTUOSO);
if (!wxStricmp(dbInf.dbmsName,"Adaptive Server Anywhere")) if (!wxStricmp(dbInf.dbmsName,"Adaptive Server Anywhere"))
return(dbmsSYBASE_ASA); return(dbmsSYBASE_ASA);
// BJO 20000427 : The "SQL Server" string is also returned by SQLServer when // BJO 20000427 : The "SQL Server" string is also returned by SQLServer when
// connected trhough an OpenLink driver. // connected through an OpenLink driver.
// Is it also returned by Sybase? // Is it also returned by Sybase Adapatitve server?
// OpenLink driver name is OLOD3032.DLL for msw and oplodbc.so for unix // OpenLink driver name is OLOD3032.DLL for msw and oplodbc.so for unix
if (!wxStricmp(dbInf.dbmsName,"SQL Server")) if (!wxStricmp(dbInf.dbmsName,"SQL Server"))
if (!wxStrncmp(dbInf.driverName, "oplodbc", 7) || if (!wxStrncmp(dbInf.driverName, "oplodbc", 7) ||
!wxStrncmp(dbInf.driverName, "OLOD", 4)) !wxStrncmp(dbInf.driverName, "OLOD", 4))
return dbmsMS_SQL_SERVER; else return dbmsSYBASE_ASE; return dbmsMS_SQL_SERVER; else return dbmsSYBASE_ASE;
if (!wxStricmp(dbInf.dbmsName,"Microsoft SQL Server")) if (!wxStricmp(dbInf.dbmsName,"Microsoft SQL Server"))
return(dbmsMS_SQL_SERVER); return(dbmsMS_SQL_SERVER);

View File

@@ -44,6 +44,7 @@
#include "wx/ioswrap.h" #include "wx/ioswrap.h"
#endif #endif
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma hdrstop #pragma hdrstop
#endif //__BORLANDC__ #endif //__BORLANDC__