1*b1cdbd2cSJim Jagielski /************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski 23*b1cdbd2cSJim Jagielski 24*b1cdbd2cSJim Jagielski #include <osl/diagnose.h> 25*b1cdbd2cSJim Jagielski #include "propertyids.hxx" 26*b1cdbd2cSJim Jagielski namespace connectivity 27*b1cdbd2cSJim Jagielski { 28*b1cdbd2cSJim Jagielski namespace skeleton 29*b1cdbd2cSJim Jagielski { getPROPERTY_QUERYTIMEOUT()30*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_QUERYTIMEOUT() { return "QueryTimeOut"; } getPROPERTY_MAXFIELDSIZE()31*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_MAXFIELDSIZE() { return "MaxFieldSize"; } getPROPERTY_MAXROWS()32*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_MAXROWS() { return "MaxRows"; } getPROPERTY_CURSORNAME()33*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_CURSORNAME() { return "CursorName"; } getPROPERTY_RESULTSETCONCURRENCY()34*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_RESULTSETCONCURRENCY() { return "ResultSetConcurrency"; } getPROPERTY_RESULTSETTYPE()35*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_RESULTSETTYPE() { return "ResultSetType"; } getPROPERTY_FETCHDIRECTION()36*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_FETCHDIRECTION() { return "FetchDirection"; } getPROPERTY_FETCHSIZE()37*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_FETCHSIZE() { return "FetchSize"; } getPROPERTY_ESCAPEPROCESSING()38*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_ESCAPEPROCESSING() { return "EscapeProcessing"; } getPROPERTY_USEBOOKMARKS()39*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_USEBOOKMARKS() { return "UseBookmarks"; } 40*b1cdbd2cSJim Jagielski getPROPERTY_NAME()41*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_NAME() { return "Name"; } getPROPERTY_TYPE()42*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_TYPE() { return "Type"; } getPROPERTY_TYPENAME()43*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_TYPENAME() { return "TypeName"; } getPROPERTY_PRECISION()44*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_PRECISION() { return "Precision"; } getPROPERTY_SCALE()45*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_SCALE() { return "Scale"; } getPROPERTY_ISNULLABLE()46*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_ISNULLABLE() { return "IsNullable"; } getPROPERTY_ISAUTOINCREMENT()47*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_ISAUTOINCREMENT() { return "IsAutoIncrement"; } getPROPERTY_ISROWVERSION()48*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_ISROWVERSION() { return "IsRowVersion"; } getPROPERTY_DESCRIPTION()49*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_DESCRIPTION() { return "Description"; } getPROPERTY_DEFAULTVALUE()50*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_DEFAULTVALUE() { return "DefaultValue"; } 51*b1cdbd2cSJim Jagielski getPROPERTY_REFERENCEDTABLE()52*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_REFERENCEDTABLE() { return "ReferencedTable"; } getPROPERTY_UPDATERULE()53*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_UPDATERULE() { return "UpdateRule"; } getPROPERTY_DELETERULE()54*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_DELETERULE() { return "DeleteRule"; } getPROPERTY_CATALOG()55*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_CATALOG() { return "Catalog"; } getPROPERTY_ISUNIQUE()56*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_ISUNIQUE() { return "IsUnique"; } getPROPERTY_ISPRIMARYKEYINDEX()57*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_ISPRIMARYKEYINDEX() { return "IsPrimaryKeyIndex"; } getPROPERTY_ISCLUSTERED()58*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_ISCLUSTERED() { return "IsClustered"; } getPROPERTY_ISASCENDING()59*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_ISASCENDING() { return "IsAscending"; } getPROPERTY_SCHEMANAME()60*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_SCHEMANAME() { return "SchemaName"; } getPROPERTY_CATALOGNAME()61*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_CATALOGNAME() { return "CatalogName"; } getPROPERTY_COMMAND()62*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_COMMAND() { return "Command"; } getPROPERTY_CHECKOPTION()63*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_CHECKOPTION() { return "CheckOption"; } getPROPERTY_PASSWORD()64*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_PASSWORD() { return "Password"; } getPROPERTY_RELATEDCOLUMN()65*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_RELATEDCOLUMN() { return "RelatedColumn"; } 66*b1cdbd2cSJim Jagielski getSTAT_INVALID_INDEX()67*b1cdbd2cSJim Jagielski const sal_Char* getSTAT_INVALID_INDEX() { return "Invalid descriptor index"; } 68*b1cdbd2cSJim Jagielski getPROPERTY_FUNCTION()69*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_FUNCTION() { return "Function"; } getPROPERTY_TABLENAME()70*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_TABLENAME() { return "TableName"; } getPROPERTY_REALNAME()71*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_REALNAME() { return "RealName"; } getPROPERTY_DBASEPRECISIONCHANGED()72*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_DBASEPRECISIONCHANGED() { return "DbasePrecisionChanged"; } getPROPERTY_ISCURRENCY()73*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_ISCURRENCY() { return "IsCurrency"; } getPROPERTY_ISBOOKMARKABLE()74*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_ISBOOKMARKABLE() { return "IsBookmarkable"; } 75*b1cdbd2cSJim Jagielski getPROPERTY_FORMATKEY()76*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_FORMATKEY() { return "FormatKey"; } getPROPERTY_LOCALE()77*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_LOCALE() { return "Locale"; } 78*b1cdbd2cSJim Jagielski getPROPERTY_AUTOINCREMENTCREATION()79*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_AUTOINCREMENTCREATION() { return "AutoIncrementCreation"; } getPROPERTY_PRIVILEGES()80*b1cdbd2cSJim Jagielski const sal_Char* getPROPERTY_PRIVILEGES() { return "Privileges"; } 81*b1cdbd2cSJim Jagielski //============================================================ 82*b1cdbd2cSJim Jagielski //= error messages 83*b1cdbd2cSJim Jagielski //============================================================ getERRORMSG_SEQUENCE()84*b1cdbd2cSJim Jagielski const sal_Char* getERRORMSG_SEQUENCE() { return "Function sequence error"; } getSQLSTATE_SEQUENCE()85*b1cdbd2cSJim Jagielski const sal_Char* getSQLSTATE_SEQUENCE() { return "HY010"; } getSQLSTATE_GENERAL()86*b1cdbd2cSJim Jagielski const sal_Char* getSQLSTATE_GENERAL() { return "HY0000"; } getSTR_DELIMITER()87*b1cdbd2cSJim Jagielski const sal_Char* getSTR_DELIMITER() { return "/"; } 88*b1cdbd2cSJim Jagielski ~OPropertyMap()89*b1cdbd2cSJim Jagielski OPropertyMap::~OPropertyMap() 90*b1cdbd2cSJim Jagielski { 91*b1cdbd2cSJim Jagielski ::std::map<sal_Int32 , rtl_uString*>::iterator aIter = m_aPropertyMap.begin(); 92*b1cdbd2cSJim Jagielski for(;aIter != m_aPropertyMap.end();++aIter) 93*b1cdbd2cSJim Jagielski if(aIter->second) 94*b1cdbd2cSJim Jagielski rtl_uString_release(aIter->second); 95*b1cdbd2cSJim Jagielski } 96*b1cdbd2cSJim Jagielski // ------------------------------------------------------------------------------ getNameByIndex(sal_Int32 _nIndex) const97*b1cdbd2cSJim Jagielski ::rtl::OUString OPropertyMap::getNameByIndex(sal_Int32 _nIndex) const 98*b1cdbd2cSJim Jagielski { 99*b1cdbd2cSJim Jagielski ::rtl::OUString sRet; 100*b1cdbd2cSJim Jagielski ::std::map<sal_Int32 , rtl_uString*>::const_iterator aIter = m_aPropertyMap.find(_nIndex); 101*b1cdbd2cSJim Jagielski if(aIter == m_aPropertyMap.end()) 102*b1cdbd2cSJim Jagielski sRet = const_cast<OPropertyMap*>(this)->fillValue(_nIndex); 103*b1cdbd2cSJim Jagielski else 104*b1cdbd2cSJim Jagielski sRet = aIter->second; 105*b1cdbd2cSJim Jagielski return sRet; 106*b1cdbd2cSJim Jagielski } 107*b1cdbd2cSJim Jagielski // ------------------------------------------------------------------------------ fillValue(sal_Int32 _nIndex)108*b1cdbd2cSJim Jagielski ::rtl::OUString OPropertyMap::fillValue(sal_Int32 _nIndex) 109*b1cdbd2cSJim Jagielski { 110*b1cdbd2cSJim Jagielski rtl_uString* pStr = NULL; 111*b1cdbd2cSJim Jagielski switch(_nIndex) 112*b1cdbd2cSJim Jagielski { 113*b1cdbd2cSJim Jagielski case PROPERTY_ID_QUERYTIMEOUT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_QUERYTIMEOUT() ); break; } 114*b1cdbd2cSJim Jagielski case PROPERTY_ID_MAXFIELDSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXFIELDSIZE() ); break; } 115*b1cdbd2cSJim Jagielski case PROPERTY_ID_MAXROWS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXROWS() ); break; } 116*b1cdbd2cSJim Jagielski case PROPERTY_ID_CURSORNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CURSORNAME() ); break; } 117*b1cdbd2cSJim Jagielski case PROPERTY_ID_RESULTSETCONCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETCONCURRENCY() ); break; } 118*b1cdbd2cSJim Jagielski case PROPERTY_ID_RESULTSETTYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETTYPE() ); break; } 119*b1cdbd2cSJim Jagielski case PROPERTY_ID_FETCHDIRECTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHDIRECTION() ); break; } 120*b1cdbd2cSJim Jagielski case PROPERTY_ID_FETCHSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHSIZE() ); break; } 121*b1cdbd2cSJim Jagielski case PROPERTY_ID_ESCAPEPROCESSING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ESCAPEPROCESSING() ); break; } 122*b1cdbd2cSJim Jagielski case PROPERTY_ID_USEBOOKMARKS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_USEBOOKMARKS() ); break; } 123*b1cdbd2cSJim Jagielski // Column 124*b1cdbd2cSJim Jagielski case PROPERTY_ID_NAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_NAME() ); break; } 125*b1cdbd2cSJim Jagielski case PROPERTY_ID_TYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPE() ); break; } 126*b1cdbd2cSJim Jagielski case PROPERTY_ID_TYPENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPENAME() ); break; } 127*b1cdbd2cSJim Jagielski case PROPERTY_ID_PRECISION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRECISION() ); break; } 128*b1cdbd2cSJim Jagielski case PROPERTY_ID_SCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCALE() ); break; } 129*b1cdbd2cSJim Jagielski case PROPERTY_ID_ISNULLABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISNULLABLE() ); break; } 130*b1cdbd2cSJim Jagielski case PROPERTY_ID_ISAUTOINCREMENT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISAUTOINCREMENT() ); break; } 131*b1cdbd2cSJim Jagielski case PROPERTY_ID_ISROWVERSION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISROWVERSION() ); break; } 132*b1cdbd2cSJim Jagielski case PROPERTY_ID_DESCRIPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DESCRIPTION() ); break; } 133*b1cdbd2cSJim Jagielski case PROPERTY_ID_DEFAULTVALUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DEFAULTVALUE() ); break; } 134*b1cdbd2cSJim Jagielski 135*b1cdbd2cSJim Jagielski case PROPERTY_ID_REFERENCEDTABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REFERENCEDTABLE() ); break; } 136*b1cdbd2cSJim Jagielski case PROPERTY_ID_UPDATERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_UPDATERULE() ); break; } 137*b1cdbd2cSJim Jagielski case PROPERTY_ID_DELETERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DELETERULE() ); break; } 138*b1cdbd2cSJim Jagielski case PROPERTY_ID_CATALOG: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOG() ); break; } 139*b1cdbd2cSJim Jagielski case PROPERTY_ID_ISUNIQUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISUNIQUE() ); break; } 140*b1cdbd2cSJim Jagielski case PROPERTY_ID_ISPRIMARYKEYINDEX: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISPRIMARYKEYINDEX() ); break; } 141*b1cdbd2cSJim Jagielski case PROPERTY_ID_ISCLUSTERED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCLUSTERED() ); break; } 142*b1cdbd2cSJim Jagielski case PROPERTY_ID_ISASCENDING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISASCENDING() ); break; } 143*b1cdbd2cSJim Jagielski case PROPERTY_ID_SCHEMANAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCHEMANAME() ); break; } 144*b1cdbd2cSJim Jagielski case PROPERTY_ID_CATALOGNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOGNAME() ); break; } 145*b1cdbd2cSJim Jagielski 146*b1cdbd2cSJim Jagielski case PROPERTY_ID_COMMAND: { rtl_uString_newFromAscii(&pStr,getPROPERTY_COMMAND() ); break; } 147*b1cdbd2cSJim Jagielski case PROPERTY_ID_CHECKOPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CHECKOPTION() ); break; } 148*b1cdbd2cSJim Jagielski case PROPERTY_ID_PASSWORD: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PASSWORD() ); break; } 149*b1cdbd2cSJim Jagielski case PROPERTY_ID_RELATEDCOLUMN: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RELATEDCOLUMN() ); break; } 150*b1cdbd2cSJim Jagielski 151*b1cdbd2cSJim Jagielski case PROPERTY_ID_FUNCTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FUNCTION() ); break; } 152*b1cdbd2cSJim Jagielski case PROPERTY_ID_TABLENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TABLENAME() ); break; } 153*b1cdbd2cSJim Jagielski case PROPERTY_ID_REALNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REALNAME() ); break; } 154*b1cdbd2cSJim Jagielski case PROPERTY_ID_DBASEPRECISIONCHANGED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DBASEPRECISIONCHANGED() ); break; } 155*b1cdbd2cSJim Jagielski case PROPERTY_ID_ISCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCURRENCY() ); break; } 156*b1cdbd2cSJim Jagielski case PROPERTY_ID_ISBOOKMARKABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISBOOKMARKABLE() ); break; } 157*b1cdbd2cSJim Jagielski case PROPERTY_ID_INVALID_INDEX: { rtl_uString_newFromAscii(&pStr,getSTAT_INVALID_INDEX() ); break; } 158*b1cdbd2cSJim Jagielski case PROPERTY_ID_ERRORMSG_SEQUENCE: { rtl_uString_newFromAscii(&pStr,getERRORMSG_SEQUENCE() ); break; } 159*b1cdbd2cSJim Jagielski case PROPERTY_ID_HY010: { rtl_uString_newFromAscii(&pStr,getSQLSTATE_SEQUENCE() ); break; } 160*b1cdbd2cSJim Jagielski case PROPERTY_ID_HY0000: { rtl_uString_newFromAscii(&pStr,getSQLSTATE_GENERAL() ); break; } 161*b1cdbd2cSJim Jagielski case PROPERTY_ID_DELIMITER: { rtl_uString_newFromAscii(&pStr,getSTR_DELIMITER() ); break; } 162*b1cdbd2cSJim Jagielski case PROPERTY_ID_FORMATKEY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FORMATKEY() ); break; } 163*b1cdbd2cSJim Jagielski case PROPERTY_ID_LOCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_LOCALE() ); break; } 164*b1cdbd2cSJim Jagielski case PROPERTY_ID_AUTOINCREMENTCREATION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_AUTOINCREMENTCREATION() ); break; } 165*b1cdbd2cSJim Jagielski case PROPERTY_ID_PRIVILEGES: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRIVILEGES() ); break; } 166*b1cdbd2cSJim Jagielski } 167*b1cdbd2cSJim Jagielski m_aPropertyMap[_nIndex] = pStr; 168*b1cdbd2cSJim Jagielski return pStr; 169*b1cdbd2cSJim Jagielski } 170*b1cdbd2cSJim Jagielski } 171*b1cdbd2cSJim Jagielski } 172